@muyichengshayu/promptx 0.1.21 → 0.1.22

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.
@@ -0,0 +1,236 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodexSessionManagerDialog-ByhnEYj3.js","assets/index-BcbMELCK.js","assets/index-Dd5oL2Cq.css","assets/info-Db3PDen4.js","assets/TaskDiffReviewDialog-0raSVHe9.js","assets/WorkbenchSettingsDialog-Ccnbb1aO.js"])))=>i.map(i=>d[i]);
2
+ import{h as Zn,w as Ee,o as ft,a as E,c as we,b as O,d as p,n as Se,e as ie,u as l,t as A,f as ve,g as Ve,T as hu,i as le,j as _t,F as mt,r as Ft,k as ln,l as mu,m as Pu,p as fu,q as gn,s as H,v as De,x as Re,y as Zt,z as en,A as Eo,B as Et,C as wn,D as xr,E as Tn,G as mi,H as Xn,_ as Yn,I as Bu,J as gi,K as bi,L as xi,M as au,N as lu,O as Ao}from"./index-BcbMELCK.js";/**
3
+ * @license lucide-vue-next v0.577.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
+ */const vi=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
8
+ * @license lucide-vue-next v0.577.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 Do=e=>e==="";/**
13
+ * @license lucide-vue-next v0.577.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 yi=(...e)=>e.filter((t,u,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===u).join(" ").trim();/**
18
+ * @license lucide-vue-next v0.577.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 Io=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
23
+ * @license lucide-vue-next v0.577.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 ki=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,u,n)=>n?n.toUpperCase():u.toLowerCase());/**
28
+ * @license lucide-vue-next v0.577.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 _i=e=>{const t=ki(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
33
+ * @license lucide-vue-next v0.577.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
+ */var Fu={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
38
+ * @license lucide-vue-next v0.577.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 Si=({name:e,iconNode:t,absoluteStrokeWidth:u,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":o,size:i=Fu.width,color:s=Fu.stroke,...a},{slots:d})=>Zn("svg",{...Fu,...a,width:i,height:i,stroke:s,"stroke-width":Do(u)||Do(n)||u===!0||n===!0?Number(r||o||Fu["stroke-width"])*24/Number(i):r||o||Fu["stroke-width"],class:yi("lucide",a.class,...e?[`lucide-${Io(_i(e))}-icon`,`lucide-${Io(e)}`]:["lucide-icon"]),...!d.default&&!vi(a)&&{"aria-hidden":"true"}},[...t.map(c=>Zn(...c)),...d.default?[d.default()]:[]]);/**
43
+ * @license lucide-vue-next v0.577.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 Fe=(e,t)=>(u,{slots:n,attrs:r})=>Zn(Si,{...r,...u,iconNode:t,name:e},n);/**
48
+ * @license lucide-vue-next v0.577.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 wi=Fe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
53
+ * @license lucide-vue-next v0.577.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 Ti=Fe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
58
+ * @license lucide-vue-next v0.577.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 Ci=Fe("arrow-up-left",[["path",{d:"M7 17V7h10",key:"11bw93"}],["path",{d:"M17 17 7 7",key:"2786uv"}]]);/**
63
+ * @license lucide-vue-next v0.577.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 Fo=Fe("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]);/**
68
+ * @license lucide-vue-next v0.577.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 Ei=Fe("blocks",[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]);/**
73
+ * @license lucide-vue-next v0.577.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 Ai=Fe("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"}]]);/**
78
+ * @license lucide-vue-next v0.577.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 Di=Fe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
83
+ * @license lucide-vue-next v0.577.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 Lu=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
88
+ * @license lucide-vue-next v0.577.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 Ii=Fe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
93
+ * @license lucide-vue-next v0.577.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 Mn=Fe("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
98
+ * @license lucide-vue-next v0.577.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 vr=Fe("circle-alert",[["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"}]]);/**
103
+ * @license lucide-vue-next v0.577.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 Fi=Fe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
108
+ * @license lucide-vue-next v0.577.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 $i=Fe("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);/**
113
+ * @license lucide-vue-next v0.577.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 bn=Fe("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/**
118
+ * @license lucide-vue-next v0.577.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 $o=Fe("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
123
+ * @license lucide-vue-next v0.577.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 Jn=Fe("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
128
+ * @license lucide-vue-next v0.577.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 Pn=Fe("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);/**
133
+ * @license lucide-vue-next v0.577.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 tn=Fe("folder-open",[["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"}]]);/**
138
+ * @license lucide-vue-next v0.577.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 fo=Fe("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
143
+ * @license lucide-vue-next v0.577.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 Ot=Fe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
148
+ * @license lucide-vue-next v0.577.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 yr=Fe("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]);/**
153
+ * @license lucide-vue-next v0.577.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 Ou=Fe("pencil-line",[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/**
158
+ * @license lucide-vue-next v0.577.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 kr=Fe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
163
+ * @license lucide-vue-next v0.577.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 Mi=Fe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
168
+ * @license lucide-vue-next v0.577.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 Pi=Fe("scan-text",[["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"}],["path",{d:"M7 8h8",key:"1jbsf9"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h6",key:"1vyc9m"}]]);/**
173
+ * @license lucide-vue-next v0.577.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 Bi=Fe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/**
178
+ * @license lucide-vue-next v0.577.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 Ri=Fe("send-horizontal",[["path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",key:"117uat"}],["path",{d:"M6 12h16",key:"s4cdu5"}]]);/**
183
+ * @license lucide-vue-next v0.577.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 Li=Fe("settings-2",[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
188
+ * @license lucide-vue-next v0.577.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 Nu=Fe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);/**
193
+ * @license lucide-vue-next v0.577.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 Ni=Fe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
198
+ * @license lucide-vue-next v0.577.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 Oi=Fe("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/**
203
+ * @license lucide-vue-next v0.577.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 zi=Fe("wand-sparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
208
+ * @license lucide-vue-next v0.577.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 Cn=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),qi={class:"panel w-full max-w-md overflow-hidden"},Ui={class:"theme-divider flex items-start justify-between gap-3 border-b px-5 py-4"},ji={class:"flex items-start gap-3"},Vi={class:"theme-heading text-base font-semibold"},Hi={key:0,class:"theme-muted-text mt-1 text-sm leading-6"},Wi=["disabled"],Ki={class:"flex justify-end gap-2 px-5 py-4"},Gi=["disabled"],Zi=["disabled"],un={__name:"ConfirmDialog",props:{open:{type:Boolean,default:!1},title:{type:String,default:""},description:{type:String,default:""},confirmText:{type:String,default:""},cancelText:{type:String,default:""},loading:{type:Boolean,default:!1},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=le(()=>u.title||r("common.confirm")),i=le(()=>u.confirmText||r("common.confirm")),s=le(()=>u.cancelText||r("common.cancel"));function a(d){!u.open||u.loading||d.key==="Escape"&&n("cancel")}return Ee(()=>u.open,d=>{if(document.body.classList.toggle("overflow-hidden",d),d){window.addEventListener("keydown",a);return}window.removeEventListener("keydown",a)}),ft(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",a)}),(d,c)=>(E(),we(hu,{to:"body"},[e.open?(E(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[90] flex items-center justify-center px-4",onClick:c[3]||(c[3]=Ve(f=>!e.loading&&n("cancel"),["self"]))},[p("section",qi,[p("div",Ui,[p("div",ji,[p("span",{class:Se(["inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-sm border border-dashed",e.danger?"theme-status-danger":"theme-status-neutral"])},[ie(l(Ni),{class:"h-4 w-4"})],2),p("div",null,[p("h2",Vi,A(o.value),1),e.description?(E(),O("p",Hi,A(e.description),1)):ve("",!0)])]),p("button",{type:"button",class:"theme-icon-button h-8 w-8",disabled:e.loading,onClick:c[0]||(c[0]=f=>n("cancel"))},[ie(l(Cn),{class:"h-4 w-4"})],8,Wi)]),p("div",Ki,[p("button",{type:"button",class:"tool-button px-4 py-2 text-sm",disabled:e.loading,onClick:c[1]||(c[1]=f=>n("cancel"))},A(s.value),9,Gi),p("button",{type:"button",class:Se(["tool-button px-4 py-2 text-sm",e.danger?"tool-button-danger":"tool-button-primary"]),disabled:e.loading,onClick:c[2]||(c[2]=f=>n("confirm"))},A(e.loading?l(r)("common.processing"):i.value),11,Zi)])])])):ve("",!0)]))}},Ht={NONE:"none",LATEST:"latest",ALL:"all"};function Xi(e="",t={}){const u=String(e||"").trim().toLowerCase();return u===Ht.ALL?Ht.ALL:u===Ht.LATEST?Ht.LATEST:u===Ht.NONE?Ht.NONE:t.includeEvents?Ht.ALL:t.includeLatestEvents?Ht.LATEST:Ht.NONE}const Ct={SESSION:"session",SESSION_UPDATED:"session.updated",STATUS:"status",STDOUT:"stdout",STDERR:"stderr",AGENT_EVENT:"agent_event",COMPLETED:"completed",STOPPED:"stopped",ERROR:"error"};function _r(e=""){const t=String(e||"").trim().toLowerCase();return t==="codex"?Ct.AGENT_EVENT:t}const Qe={THREAD_STARTED:"thread.started",TURN_STARTED:"turn.started",TURN_COMPLETED:"turn.completed",TURN_FAILED:"turn.failed",ERROR:"error",ITEM_STARTED:"item.started",ITEM_UPDATED:"item.updated",ITEM_COMPLETED:"item.completed"},Ne={REASONING:"reasoning",WEB_SEARCH:"web_search",COLLAB_TOOL_CALL:"collab_tool_call",FILE_CHANGE:"file_change",COMMAND_EXECUTION:"command_execution",TODO_LIST:"todo_list",AGENT_MESSAGE:"agent_message"},Yi={none:{label:"不过期",hours:null}};Object.entries(Yi).map(([e,t])=>({value:e,label:t.label}));const cn={CODEX:"codex",CLAUDE_CODE:"claude-code",OPENCODE:"opencode"},Sr=[{value:cn.CODEX,label:"Codex",enabled:!0},{value:cn.CLAUDE_CODE,label:"Claude Code",enabled:!0},{value:cn.OPENCODE,label:"OpenCode",enabled:!0}],Pe={TEXT:"text",IMAGE:"image",IMPORTED_TEXT:"imported_text"};Pe.TEXT+"",Pe.IMAGE+"",Pe.IMPORTED_TEXT+"";const Ji=[{value:"local",label:"跟随本机时区"}],Qi={SKIP:"skip"},es=[{value:Qi.SKIP,label:"已有运行时跳过本次"}],Bn={DINGTALK:"dingtalk",FEISHU:"feishu",WEBHOOK:"webhook"},ts=[{value:Bn.DINGTALK,label:"钉钉 Webhook"},{value:Bn.FEISHU,label:"飞书 Webhook"},{value:Bn.WEBHOOK,label:"通用 Webhook"}],Rn={COMPLETED:"completed",SUCCESS:"success",ERROR:"error"},us=[{value:Rn.COMPLETED,label:"本次运行结束后"},{value:Rn.SUCCESS,label:"本次运行成功后"},{value:Rn.ERROR,label:"本次运行失败后"}],ns={SUMMARY:"summary"},os=[{value:ns.SUMMARY,label:"摘要消息"}],Mo={ZH_CN:"zh-CN",EN_US:"en-US"},rs=[{value:Mo.ZH_CN,label:"简体中文"},{value:Mo.EN_US,label:"English"}];function wr(e){var u;const t=String(e||"").trim().toLowerCase();return((u=Sr.find(n=>n.value===t))==null?void 0:u.value)||cn.CODEX}function Ge(e){var t;return((t=Sr.find(u=>u.value===wr(e)))==null?void 0:t.label)||"Codex"}function is(e=[],t=10){const u=e.find(n=>{var r;return(n.type===Pe.TEXT||n.type===Pe.IMPORTED_TEXT)&&((r=n.content)==null?void 0:r.trim())});return u?u.content.replace(/\s+/g," ").trim().slice(0,t):""}const ss={class:"theme-divider settings-dialog-nav border-b px-3 py-3 sm:w-60 sm:shrink-0 sm:border-b-0 sm:border-r sm:px-4 sm:py-4"},as={class:"settings-nav flex gap-2 overflow-x-auto sm:flex-col sm:overflow-visible"},ls=["onClick"],cs={class:"min-w-0"},ds={class:"text-sm font-medium"},fs={class:"theme-muted-text mt-1 hidden text-xs leading-5 sm:block"},ps={__name:"DialogSideNav",props:{modelValue:{type:String,default:""},sections:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=t;function n(r=""){u("update:modelValue",String(r||""))}return(r,o)=>(E(),O("aside",ss,[p("nav",as,[(E(!0),O(mt,null,Ft(e.sections,i=>(E(),O("button",{key:i.id,type:"button",class:Se(["settings-nav__item flex min-w-0 items-start gap-3 rounded-sm border px-3 py-3 text-left transition sm:w-full",e.modelValue===i.id?"theme-card-selected":"theme-card-idle-muted border-dashed hover:border-[var(--theme-borderStrong)] hover:bg-[var(--theme-appPanelStrong)]"]),onClick:s=>n(i.id)},[(E(),we(ln(i.icon),{class:"mt-0.5 h-4 w-4 shrink-0"})),p("div",cs,[p("div",ds,A(i.label),1),p("p",fs,A(i.description),1)])],10,ls))),128))])]))}},hs=["disabled","onKeydown"],ms={class:"min-w-0 flex-1"},gs={class:"theme-muted-text text-sm"},bs={class:"flex min-h-0 w-full flex-col"},xs={class:"min-h-0 flex-1 space-y-2 overflow-y-auto p-2"},vs=["onClick"],ys={class:"theme-empty-state px-3 py-4 text-sm"},Kt={__name:"WorkbenchSelect",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:""},emptyText:{type:String,default:""},getOptionValue:{type:Function,default:e=>(e==null?void 0:e.id)??(e==null?void 0:e.value)??""}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=H(null),i=H(null),s=H(!1),a=H(!1),d=H({}),c=le(()=>{const $=String(u.modelValue??"");return u.options.find(te=>String(u.getOptionValue(te)??"")===$)||null}),f=le(()=>u.placeholder||r("common.select")),m=le(()=>u.emptyText||r("common.noOptions"));function _($){return $&&typeof $=="object"&&Object.prototype.hasOwnProperty.call($,"label")?String($.label||""):String(u.getOptionValue($)??"")}function g(){u.disabled||(s.value||n("refresh-intent"),s.value=!0)}function F(){s.value=!1}function B(){if(s.value){F();return}g()}function v($){n("update:modelValue",String(u.getOptionValue($)??"").trim()),F()}function x(){if(!s.value||!o.value||typeof window>"u")return;const $=o.value.getBoundingClientRect(),te=window.innerWidth,C=window.innerHeight,Q=8,Y=8,N=160,q=360,ue=Math.max(0,C-$.bottom-Y),ae=Math.max(0,$.top-Y);a.value=ue<260&&ae>ue;const me=a.value?ae-Q:ue-Q,ce=Math.max(Math.min(q,Math.max(me,0)),Math.min(N,a.value?ae:ue)),ye=Math.min($.width,te-Y*2),j=Math.min(Math.max(Y,$.left),Math.max(Y,te-Y-ye));d.value={left:`${j}px`,top:a.value?`${$.top-Q}px`:`${$.bottom+Q}px`,width:`${ye}px`,maxHeight:`${Math.max(ce,120)}px`,transform:a.value?"translateY(-100%)":"none"}}function D($){var te;!s.value||!o.value||o.value.contains($.target)||(te=i.value)!=null&&te.contains($.target)||F()}function L($){$.key==="Escape"&&F()}return Ee(()=>u.disabled,$=>{$&&F()}),Ee(s,async $=>{$&&(await De(),x())}),mu(()=>{document.addEventListener("pointerdown",D),document.addEventListener("keydown",L),window.addEventListener("resize",x),window.addEventListener("scroll",x,!0)}),ft(()=>{document.removeEventListener("pointerdown",D),document.removeEventListener("keydown",L),window.removeEventListener("resize",x),window.removeEventListener("scroll",x,!0)}),($,te)=>(E(),O("div",{ref_key:"rootRef",ref:o,class:"relative min-w-0"},[p("button",{type:"button",class:Se(["workbench-select-trigger flex w-full items-center gap-3 rounded-sm border px-3 py-2 text-left transition focus:outline-none focus:ring-2",e.disabled?"cursor-not-allowed border-[color-mix(in_srgb,var(--theme-borderDefault)_88%,var(--theme-textMuted))] bg-[color-mix(in_srgb,var(--theme-appPanelMuted)_82%,var(--theme-appBg))] text-[var(--theme-textMuted)]":"theme-input-shell text-[var(--theme-textPrimary)] hover:border-[var(--theme-borderStrong)] focus:border-[var(--theme-borderStrong)] focus:ring-[var(--theme-focusRing)]"]),disabled:e.disabled,onClick:B,onKeydown:[fu(Ve(g,["prevent"]),["down"]),fu(Ve(B,["prevent"]),["enter"]),fu(Ve(B,["prevent"]),["space"])]},[p("div",ms,[Pu($.$slots,"trigger",{selectedOption:c.value,open:s.value,loading:e.loading,disabled:e.disabled},()=>[p("div",gs,A(c.value?_(c.value):f.value),1)])]),p("div",{class:Se(["flex shrink-0 items-center gap-2",e.disabled?"text-[var(--theme-textMuted)] opacity-80":"theme-muted-text"])},[e.loading?(E(),we(l(Ot),{key:0,class:"h-4 w-4 animate-spin"})):ve("",!0),ie(l(Lu),{class:Se(["h-4 w-4 transition",s.value?"rotate-180":""])},null,8,["class"])],2)],42,hs),(E(),we(hu,{to:"body"},[s.value?(E(),O("div",{key:0,ref_key:"panelRef",ref:i,class:"workbench-select-panel theme-popover fixed z-[90] flex overflow-hidden rounded-sm border",style:gn(d.value)},[p("div",bs,[Pu($.$slots,"header",{loading:e.loading,options:e.options}),p("div",xs,[e.options.length?(E(!0),O(mt,{key:0},Ft(e.options,C=>Pu($.$slots,"option",{key:String(e.getOptionValue(C)??""),option:C,selected:String(e.getOptionValue(C)??"")===String(e.modelValue??""),select:()=>v(C)},()=>[p("button",{type:"button",class:"workbench-select-option theme-filter-idle w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm",onClick:Q=>v(C)},A(_(C)),9,vs)])),128)):Pu($.$slots,"empty",{key:1},()=>[p("div",ys,A(m.value),1)])])])],4)):ve("",!0)]))],512))}},Po={},Tr=typeof import.meta<"u"&&Po?Po:{};function ks(){if(typeof window>"u")return"http://localhost:3000";const e=new URL(window.location.origin),t=String(Tr.VITE_API_PORT||"").trim();if(t)return e.port=t,e.toString().replace(/\/$/,"");const u=String(e.port||"");return new Set(["4173","5173","5174"]).has(u)?(e.port="3000",e.toString().replace(/\/$/,"")):e.toString().replace(/\/$/,"")}const po=(Tr.VITE_API_BASE_URL||ks()).replace(/\/$/,"");function ho(e={},t="errors.requestFailed"){const u=String((e==null?void 0:e.messageKey)||"").trim();if(u){const n=Re(u);if(n&&n!==u)return n}return(e==null?void 0:e.message)||Re(t)}async function He(e,t={}){const u=typeof t.body<"u"&&!(t.body instanceof FormData),n=await fetch(`${po}${e}`,{headers:{...u?{"Content-Type":"application/json"}:{},...t.headers||{}},...t});if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(ho(o))}return n.status===204?null:(n.headers.get("content-type")||"").includes("application/json")?n.json():n.text()}function mo(){return po}function dn(e){return e?e.startsWith("http")?e:`${po}${e}`:""}function im(){return He("/api/meta",{cache:"no-store"})}function _s(){return He("/api/tasks")}function Ss(e=30){const t=new URLSearchParams,u=Math.max(1,Number(e)||30);return t.set("limit",String(u)),He(`/api/tasks/workspace-diff-summaries?${t.toString()}`,{cache:"no-store"})}function ws(e){return He("/api/tasks",{method:"POST",body:JSON.stringify(e)})}function Cr(e){return He(`/api/tasks/${e}`)}function Er(e,t){return He(`/api/tasks/${e}`,{method:"PUT",body:JSON.stringify(t)})}function Ts(e){return He(`/api/tasks/${e}`,{method:"DELETE"})}const Ar=mo();async function Cs(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Ar}/api/uploads`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(ho(n,"errors.uploadFailed"))}return u.json()}async function Es(e){const t=new FormData;t.append("file",e);const u=await fetch(`${Ar}/api/imports/pdf`,{method:"POST",body:t});if(!u.ok){const n=await u.json().catch(()=>({}));throw new Error(ho(n,"errors.pdfImportFailed"))}return u.json()}function As(){return He("/api/codex/sessions")}function Ds(e={}){const t=new URLSearchParams,u=String(e.engine||"").trim();u&&t.set("engine",u);const n=t.toString();return He(`/api/codex/workspaces${n?`?${n}`:""}`)}function sm(e={}){const t=new URLSearchParams,u=String(e.path||"").trim(),n=Number(e.limit||0);u&&t.set("path",u),Number.isFinite(n)&&n>0&&t.set("limit",String(n));const r=t.toString();return He(`/api/codex/directories/tree${r?`?${r}`:""}`,{cache:"no-store"})}function am(e,t={}){const u=new URLSearchParams,n=String(e||"").trim(),r=String(t.path||"").trim(),o=Number(t.limit||0);n&&u.set("q",n),r&&u.set("path",r),Number.isFinite(o)&&o>0&&u.set("limit",String(o));const i=u.toString();return He(`/api/codex/directories/search${i?`?${i}`:""}`,{cache:"no-store"})}function Is(e){return He("/api/codex/sessions",{method:"POST",body:JSON.stringify(e)})}function Fs(e,t){return He(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify(t)})}function $s(e){return He(`/api/codex/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})}function Ms(e,t={}){const u=new URLSearchParams,n=String(t.path||"").trim(),r=String(t.refreshToken||"").trim();n&&u.set("path",n),r&&u.set("_",r);const o=u.toString();return He(`/api/codex/sessions/${encodeURIComponent(e)}/files/tree${o?`?${o}`:""}`,{cache:"no-store"})}function Ps(e,t,u={}){const n=new URLSearchParams,r=String(t||"").trim(),o=Number(u.limit||60),i=String(u.refreshToken||"").trim();r&&n.set("q",r),Number.isFinite(o)&&o>0&&n.set("limit",String(o)),i&&n.set("_",i);const s=n.toString();return He(`/api/codex/sessions/${encodeURIComponent(e)}/files/search${s?`?${s}`:""}`,{cache:"no-store"})}function Bs(e,t){return He(`/api/tasks/${encodeURIComponent(e)}/codex-session`,{method:"POST",body:JSON.stringify({sessionId:t})})}function Rs(e,t={}){const u=new URLSearchParams,n=Number(t.limit||20),r=Xi(t.events,t);Number.isFinite(n)&&n>0&&u.set("limit",String(n)),u.set("events",r);const o=u.toString();return He(`/api/tasks/${encodeURIComponent(e)}/codex-runs${o?`?${o}`:""}`,{cache:"no-store"})}function Ls(e,t={}){const u=new URLSearchParams,n=Math.max(0,Number(t.afterSeq)||0),r=Math.max(1,Number(t.limit)||5e3);n>0&&u.set("afterSeq",String(n)),r>0&&u.set("limit",String(r));const o=u.toString();return He(`/api/codex/runs/${encodeURIComponent(e)}/events${o?`?${o}`:""}`,{cache:"no-store"})}function lm(e,t={}){const u=new URLSearchParams,n=String(t.scope||"workspace").trim(),r=String(t.runId||"").trim(),o=String(t.filePath||"").trim(),i=t.includeFiles!==!1,s=t.includeStats!==!1;n==="run"?u.set("scope","run"):n==="task"?u.set("scope","task"):u.set("scope","workspace"),r&&u.set("runId",r),o&&u.set("filePath",o),i||u.set("includeFiles","false"),s||u.set("includeStats","false");const a=u.toString();return He(`/api/tasks/${encodeURIComponent(e)}/git-diff${a?`?${a}`:""}`,{cache:"no-store"})}function Ns(e,t){return He(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"POST",body:JSON.stringify(t)})}function Os(e){return He(`/api/tasks/${encodeURIComponent(e)}/codex-runs`,{method:"DELETE"})}function zs(e){return He(`/api/codex/runs/${encodeURIComponent(e)}/stop`,{method:"POST"})}const qs={class:"panel settings-dialog-panel flex h-full w-full max-w-5xl flex-col overflow-hidden sm:h-[42rem] sm:max-h-[88vh]"},Us={class:"theme-divider settings-dialog-header flex items-start justify-between gap-4 border-b px-5 py-4"},js={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Vs={class:"theme-muted-text mt-1 text-xs"},Hs={class:"settings-dialog-body min-h-0 flex flex-1 flex-col sm:flex-row"},Ws={class:"settings-dialog-content min-h-0 flex-1 overflow-y-auto px-5 py-5"},Ks={key:0,class:"theme-muted-text flex items-center gap-2 py-4 text-sm"},Gs={key:1,class:"space-y-4"},Zs={key:0,class:"space-y-4"},Xs={class:"theme-heading text-base font-medium"},Ys={class:"theme-muted-text mt-1 text-xs leading-5"},Js={class:"settings-section-card px-4 py-4"},Qs={class:"block space-y-1.5"},ea={class:"theme-muted-text text-xs"},ta=["placeholder"],ua={key:1,class:"space-y-4"},na={class:"flex items-start justify-between gap-3"},oa={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},ra={class:"theme-muted-text mt-1 text-xs leading-5"},ia={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},sa={class:"settings-section-card px-4 py-4"},aa={class:"grid gap-4 sm:grid-cols-2"},la={class:"space-y-1.5 sm:col-span-2"},ca={class:"theme-muted-text text-xs"},da={class:"truncate text-sm text-[var(--theme-textPrimary)]"},fa={class:"space-y-1.5"},pa={class:"theme-muted-text text-xs"},ha=["disabled"],ma={key:0,class:"space-y-1.5"},ga={class:"theme-muted-text text-xs"},ba={class:"truncate text-sm text-[var(--theme-textPrimary)]"},xa={class:"space-y-1.5"},va={class:"theme-muted-text text-xs"},ya={class:"truncate text-sm text-[var(--theme-textPrimary)]"},ka={class:"theme-muted-text text-xs"},_a={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Sa={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},wa={key:2,class:"space-y-4"},Ta={class:"flex items-start justify-between gap-3"},Ca={class:"theme-heading inline-flex items-center gap-2 text-base font-medium"},Ea={class:"theme-muted-text mt-1 text-xs leading-5"},Aa={class:"inline-flex items-center gap-2 text-sm text-[var(--theme-textPrimary)]"},Da={class:"settings-section-card px-4 py-4"},Ia={class:"grid gap-4 sm:grid-cols-2"},Fa={class:"space-y-1.5"},$a={class:"theme-muted-text text-xs"},Ma={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Pa={class:"space-y-1.5"},Ba={class:"theme-muted-text text-xs"},Ra={class:"truncate text-sm text-[var(--theme-textPrimary)]"},La={class:"space-y-1.5 sm:col-span-2"},Na={class:"theme-muted-text text-xs"},Oa=["placeholder","disabled"],za={class:"space-y-1.5"},qa={class:"theme-muted-text text-xs"},Ua=["placeholder","disabled"],ja={class:"space-y-1.5"},Va={class:"theme-muted-text text-xs"},Ha={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Wa={class:"space-y-1.5"},Ka={class:"theme-muted-text text-xs"},Ga={class:"truncate text-sm text-[var(--theme-textPrimary)]"},Za={class:"theme-muted-text mt-3 space-y-1 text-xs leading-6"},Xa={key:0,class:"theme-danger-text"},Ya={key:3,class:"theme-danger-text text-sm"},Ja={class:"theme-divider flex flex-col gap-3 border-t px-5 py-4 sm:flex-row sm:items-center sm:justify-between"},Qa={class:"theme-muted-text theme-note-text"},el={class:"flex items-center justify-end gap-2"},tl=["disabled"],ul=["disabled"],nl="0 9 * * 1-5",Ln="weekdays",$u="09:00",vu="1",ol={__name:"EditTaskDialog",props:{open:{type:Boolean,default:!1},taskSlug:{type:String,default:""},taskTitle:{type:String,default:""}},emits:["close","saved"],setup(e,{emit:t}){const u=e,n=t,{locale:r,t:o}=_t(),i=H(!1),s=H(!1),a=H(""),d=H("basic"),c=wn({title:"",automationEnabled:!1,automationMode:Ln,automationTime:$u,automationWeekday:vu,automationTimezone:"local",automationConcurrencyPolicy:"skip",automationLastTriggeredAt:"",automationNextTriggerAt:"",notificationEnabled:!1,notificationChannelType:"dingtalk",notificationWebhookUrl:"",notificationSecret:"",notificationTriggerOn:"completed",notificationLocale:"zh-CN",notificationMessageMode:"summary",notificationLastStatus:"",notificationLastError:"",notificationLastSentAt:""}),f=le(()=>String(u.taskTitle||"").trim()||o("workbench.untitledTask")),m=le(()=>[{id:"basic",label:o("taskDialog.sections.basic.label"),description:o("taskDialog.sections.basic.description"),icon:Ou},{id:"automation",label:o("taskDialog.sections.automation.label"),description:o("taskDialog.sections.automation.description"),icon:bn},{id:"notification",label:o("taskDialog.sections.notification.label"),description:o("taskDialog.sections.notification.description"),icon:Fo}]),_=le(()=>[{value:"daily",label:o("taskDialog.sections.automation.modeDaily")},{value:"weekdays",label:o("taskDialog.sections.automation.modeWeekdays")},{value:"weekly",label:o("taskDialog.sections.automation.modeWeekly")}]),g=le(()=>[{value:"1",label:o("taskDialog.sections.automation.weekday1")},{value:"2",label:o("taskDialog.sections.automation.weekday2")},{value:"3",label:o("taskDialog.sections.automation.weekday3")},{value:"4",label:o("taskDialog.sections.automation.weekday4")},{value:"5",label:o("taskDialog.sections.automation.weekday5")},{value:"6",label:o("taskDialog.sections.automation.weekday6")},{value:"0",label:o("taskDialog.sections.automation.weekday0")}]),F=le(()=>Ji.map(j=>({...j,label:j.value==="local"?o("taskDialog.sections.automation.timezoneLocal"):j.label}))),B=le(()=>es.map(j=>({...j,label:j.value==="skip"?o("taskDialog.sections.automation.concurrencySkip"):j.label}))),v=le(()=>ts.map(j=>({...j,label:j.value==="dingtalk"?o("taskDialog.sections.notification.channelDingtalk"):j.value==="feishu"?o("taskDialog.sections.notification.channelFeishu"):j.value==="webhook"?o("taskDialog.sections.notification.channelWebhook"):j.label}))),x=le(()=>us.map(j=>({...j,label:j.value==="completed"?o("taskDialog.sections.notification.triggerCompleted"):j.value==="success"?o("taskDialog.sections.notification.triggerSuccess"):j.value==="error"?o("taskDialog.sections.notification.triggerError"):j.label}))),D=le(()=>os.map(j=>({...j,label:j.value==="summary"?o("taskDialog.sections.notification.messageSummary"):j.label}))),L=le(()=>rs.map(j=>({...j,label:j.value==="zh-CN"?o("taskDialog.sections.notification.localeZhCn"):j.value==="en-US"?o("taskDialog.sections.notification.localeEnUs"):j.label}))),$=le(()=>c.notificationEnabled?c.notificationLastStatus==="success"?o("taskDialog.sections.notification.statusSuccess"):c.notificationLastStatus==="error"?o("taskDialog.sections.notification.statusError"):o("taskDialog.sections.notification.statusPending"):o("taskDialog.sections.notification.statusDisabled"));function te(){c.title="",c.automationEnabled=!1,c.automationMode=Ln,c.automationTime=$u,c.automationWeekday=vu,c.automationTimezone="local",c.automationConcurrencyPolicy="skip",c.automationLastTriggeredAt="",c.automationNextTriggerAt="",c.notificationEnabled=!1,c.notificationChannelType="dingtalk",c.notificationWebhookUrl="",c.notificationSecret="",c.notificationTriggerOn="completed",c.notificationLocale=String(r.value||"zh-CN"),c.notificationMessageMode="summary",c.notificationLastStatus="",c.notificationLastError="",c.notificationLastSentAt=""}function C(j=0){return String(j).padStart(2,"0")}function Q(j=""){const K=String(j||"").trim().replace(/\s+/g," ");let T=K.match(/^(\d{1,2}) (\d{1,2}) \* \* 1-5$/);return T?{mode:"weekdays",time:`${C(T[2])}:${C(T[1])}`,weekday:vu}:(T=K.match(/^(\d{1,2}) (\d{1,2}) \* \* \*$/),T?{mode:"daily",time:`${C(T[2])}:${C(T[1])}`,weekday:vu}:(T=K.match(/^(\d{1,2}) (\d{1,2}) \* \* ([0-6])$/),T?{mode:"weekly",time:`${C(T[2])}:${C(T[1])}`,weekday:String(T[3])}:{mode:Ln,time:$u,weekday:vu}))}function Y(j=""){const T=String(j||"").trim().match(/^(\d{1,2}):(\d{2})$/);if(!T)return $u;const X=Number(T[1]),de=Number(T[2]);return!Number.isInteger(X)||!Number.isInteger(de)||X<0||X>23||de<0||de>59?$u:`${C(X)}:${C(de)}`}function N(){var U;const j=Y(c.automationTime),[K,T]=j.split(":"),X=Number(K),de=Number(T);if(c.automationMode==="daily")return`${de} ${X} * * *`;if(c.automationMode==="weekly"){const W=((U=g.value.find(J=>J.value===String(c.automationWeekday||"")))==null?void 0:U.value)||vu;return`${de} ${X} * * ${W}`}return`${de} ${X} * * 1-5`}function q(j={}){var T,X,de,U,W,J,ge,oe,Ie,_e,Me,$e,fe,Ze,Ye,Be;c.title=String(j.title||""),c.automationEnabled=!!((T=j.automation)!=null&&T.enabled);const K=Q(((X=j.automation)==null?void 0:X.cron)||nl);c.automationMode=K.mode,c.automationTime=K.time,c.automationWeekday=K.weekday,c.automationTimezone=String(((de=j.automation)==null?void 0:de.timezone)||"local"),c.automationConcurrencyPolicy=String(((U=j.automation)==null?void 0:U.concurrencyPolicy)||"skip"),c.automationLastTriggeredAt=String(((W=j.automation)==null?void 0:W.lastTriggeredAt)||""),c.automationNextTriggerAt=String(((J=j.automation)==null?void 0:J.nextTriggerAt)||""),c.notificationEnabled=!!((ge=j.notification)!=null&&ge.enabled),c.notificationChannelType=String(((oe=j.notification)==null?void 0:oe.channelType)||"dingtalk"),c.notificationWebhookUrl=String(((Ie=j.notification)==null?void 0:Ie.webhookUrl)||""),c.notificationSecret=String(((_e=j.notification)==null?void 0:_e.secret)||""),c.notificationTriggerOn=String(((Me=j.notification)==null?void 0:Me.triggerOn)||"completed"),c.notificationLocale=String((($e=j.notification)==null?void 0:$e.locale)||r.value||"zh-CN"),c.notificationMessageMode=String(((fe=j.notification)==null?void 0:fe.messageMode)||"summary"),c.notificationLastStatus=String(((Ze=j.notification)==null?void 0:Ze.lastStatus)||""),c.notificationLastError=String(((Ye=j.notification)==null?void 0:Ye.lastError)||""),c.notificationLastSentAt=String(((Be=j.notification)==null?void 0:Be.lastSentAt)||"")}async function ue(){const j=String(u.taskSlug||"").trim();if(!j){te();return}i.value=!0,a.value="";try{const K=await Cr(j);q(K)}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.loadFailed")}finally{i.value=!1}}function ae(){return{title:c.title,automation:{enabled:c.automationEnabled,cron:N(),timezone:c.automationTimezone,concurrencyPolicy:c.automationConcurrencyPolicy},notification:{enabled:c.notificationEnabled,channelType:c.notificationChannelType,webhookUrl:c.notificationWebhookUrl,secret:c.notificationSecret,triggerOn:c.notificationTriggerOn,locale:c.notificationLocale,messageMode:c.notificationMessageMode}}}async function me(){const j=String(u.taskSlug||"").trim();if(!(!j||i.value||s.value)){s.value=!0,a.value="";try{const K=await Er(j,ae());q(K),n("saved",K),n("close")}catch(K){a.value=(K==null?void 0:K.message)||o("taskDialog.saveFailed")}finally{s.value=!1}}}function ce(j){u.open&&j.key==="Escape"&&n("close")}function ye(j=""){if(!j)return o("common.notAvailable");const K=new Date(j);return Number.isNaN(K.getTime())?o("common.notAvailable"):xr(K.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return Ee(()=>u.open,j=>{if(document.body.classList.toggle("overflow-hidden",j),j){window.addEventListener("keydown",ce),d.value="basic",ue();return}window.removeEventListener("keydown",ce)},{immediate:!0}),Ee(()=>u.taskSlug,()=>{u.open&&ue()}),ft(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",ce)}),(j,K)=>(E(),we(hu,{to:"body"},[e.open?(E(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[75] flex items-center justify-center px-4 py-6",onClick:K[17]||(K[17]=Ve(T=>n("close"),["self"]))},[p("section",qs,[p("div",Us,[p("div",null,[p("div",js,[ie(l(Ou),{class:"h-4 w-4"}),p("span",null,A(l(o)("taskDialog.title")),1)]),p("p",Vs,A(l(o)("taskDialog.currentTask",{title:f.value})),1)]),p("button",{type:"button",class:"theme-icon-button h-8 w-8 shrink-0",onClick:K[0]||(K[0]=T=>n("close"))},[ie(l(Cn),{class:"h-4 w-4"})])]),p("div",Hs,[ie(ps,{modelValue:d.value,"onUpdate:modelValue":K[1]||(K[1]=T=>d.value=T),sections:m.value},null,8,["modelValue","sections"]),p("div",Ws,[i.value?(E(),O("div",Ks,[ie(l(Ot),{class:"h-4 w-4 animate-spin"}),p("span",null,A(l(o)("taskDialog.loading")),1)])):(E(),O("div",Gs,[d.value==="basic"?(E(),O("section",Zs,[p("div",null,[p("div",Xs,A(l(o)("taskDialog.sections.basic.title")),1),p("p",Ys,A(l(o)("taskDialog.sections.basic.intro")),1)]),p("section",Js,[p("label",Qs,[p("span",ea,A(l(o)("taskDialog.sections.basic.taskTitle")),1),Zt(p("input",{"onUpdate:modelValue":K[2]||(K[2]=T=>c.title=T),type:"text",maxlength:"140",class:"tool-input",placeholder:l(o)("taskDialog.sections.basic.taskTitlePlaceholder")},null,8,ta),[[en,c.title]])])])])):d.value==="automation"?(E(),O("section",ua,[p("div",na,[p("div",null,[p("div",oa,[ie(l(bn),{class:"h-4 w-4"}),p("span",null,A(l(o)("taskDialog.sections.automation.title")),1)]),p("p",ra,A(l(o)("taskDialog.sections.automation.intro")),1)]),p("label",ia,[Zt(p("input",{"onUpdate:modelValue":K[3]||(K[3]=T=>c.automationEnabled=T),type:"checkbox",class:"h-4 w-4"},null,512),[[Eo,c.automationEnabled]]),p("span",null,A(l(o)("taskDialog.enabled")),1)])]),p("section",sa,[p("div",aa,[p("label",la,[p("span",ca,A(l(o)("taskDialog.sections.automation.mode")),1),ie(Kt,{modelValue:c.automationMode,"onUpdate:modelValue":K[4]||(K[4]=T=>c.automationMode=T),options:_.value,disabled:!c.automationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",da,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",fa,[p("span",pa,A(l(o)("taskDialog.sections.automation.time")),1),Zt(p("input",{"onUpdate:modelValue":K[5]||(K[5]=T=>c.automationTime=T),type:"time",class:"tool-input",disabled:!c.automationEnabled},null,8,ha),[[en,c.automationTime]])]),c.automationMode==="weekly"?(E(),O("label",ma,[p("span",ga,A(l(o)("taskDialog.sections.automation.weekday")),1),ie(Kt,{modelValue:c.automationWeekday,"onUpdate:modelValue":K[6]||(K[6]=T=>c.automationWeekday=T),options:g.value,disabled:!c.automationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",ba,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])):ve("",!0),p("label",xa,[p("span",va,A(l(o)("taskDialog.sections.automation.timezone")),1),ie(Kt,{modelValue:c.automationTimezone,"onUpdate:modelValue":K[7]||(K[7]=T=>c.automationTimezone=T),options:F.value,disabled:!c.automationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",ya,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",{class:Se(["space-y-1.5",c.automationMode==="weekly"?"":"sm:col-span-2"])},[p("span",ka,A(l(o)("taskDialog.sections.automation.concurrencyPolicy")),1),ie(Kt,{modelValue:c.automationConcurrencyPolicy,"onUpdate:modelValue":K[8]||(K[8]=T=>c.automationConcurrencyPolicy=T),options:B.value,disabled:!c.automationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",_a,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])],2)]),p("div",Sa,[p("p",null,A(l(o)("taskDialog.sections.automation.lastTriggered",{value:ye(c.automationLastTriggeredAt)})),1),p("p",null,A(l(o)("taskDialog.sections.automation.nextTriggered",{value:ye(c.automationNextTriggerAt)})),1)])])])):(E(),O("section",wa,[p("div",Ta,[p("div",null,[p("div",Ca,[ie(l(Fo),{class:"h-4 w-4"}),p("span",null,A(l(o)("taskDialog.sections.notification.title")),1)]),p("p",Ea,A(l(o)("taskDialog.sections.notification.intro")),1)]),p("label",Aa,[Zt(p("input",{"onUpdate:modelValue":K[9]||(K[9]=T=>c.notificationEnabled=T),type:"checkbox",class:"h-4 w-4"},null,512),[[Eo,c.notificationEnabled]]),p("span",null,A(l(o)("taskDialog.enabled")),1)])]),p("section",Da,[p("div",Ia,[p("label",Fa,[p("span",$a,A(l(o)("taskDialog.sections.notification.channelType")),1),ie(Kt,{modelValue:c.notificationChannelType,"onUpdate:modelValue":K[10]||(K[10]=T=>c.notificationChannelType=T),options:v.value,disabled:!c.notificationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",Ma,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",Pa,[p("span",Ba,A(l(o)("taskDialog.sections.notification.triggerOn")),1),ie(Kt,{modelValue:c.notificationTriggerOn,"onUpdate:modelValue":K[11]||(K[11]=T=>c.notificationTriggerOn=T),options:x.value,disabled:!c.notificationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",Ra,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",La,[p("span",Na,A(l(o)("taskDialog.sections.notification.webhookUrl")),1),Zt(p("input",{"onUpdate:modelValue":K[12]||(K[12]=T=>c.notificationWebhookUrl=T),type:"text",class:"tool-input",placeholder:l(o)("taskDialog.sections.notification.webhookUrlPlaceholder"),disabled:!c.notificationEnabled},null,8,Oa),[[en,c.notificationWebhookUrl]])]),p("label",za,[p("span",qa,A(l(o)("taskDialog.sections.notification.secret")),1),Zt(p("input",{"onUpdate:modelValue":K[13]||(K[13]=T=>c.notificationSecret=T),type:"text",class:"tool-input",placeholder:l(o)("taskDialog.sections.notification.secretPlaceholder"),disabled:!c.notificationEnabled},null,8,Ua),[[en,c.notificationSecret]])]),p("label",ja,[p("span",Va,A(l(o)("taskDialog.sections.notification.locale")),1),ie(Kt,{modelValue:c.notificationLocale,"onUpdate:modelValue":K[14]||(K[14]=T=>c.notificationLocale=T),options:L.value,disabled:!c.notificationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",Ha,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])]),p("label",Wa,[p("span",Ka,A(l(o)("taskDialog.sections.notification.messageMode")),1),ie(Kt,{modelValue:c.notificationMessageMode,"onUpdate:modelValue":K[15]||(K[15]=T=>c.notificationMessageMode=T),options:D.value,disabled:!c.notificationEnabled,"get-option-value":T=>T.value},{trigger:Et(({selectedOption:T})=>[p("div",Ga,A((T==null?void 0:T.label)||l(o)("common.select")),1)]),_:1},8,["modelValue","options","disabled","get-option-value"])])]),p("div",Za,[p("p",null,A(l(o)("taskDialog.sections.notification.status",{value:$.value})),1),p("p",null,A(l(o)("taskDialog.sections.notification.lastSent",{value:ye(c.notificationLastSentAt)})),1),c.notificationLastError?(E(),O("p",Xa,A(l(o)("taskDialog.sections.notification.lastError",{value:c.notificationLastError})),1)):ve("",!0)])])])),a.value?(E(),O("p",Ya,A(a.value),1)):ve("",!0)]))])]),p("div",Ja,[p("p",Qa,A(l(o)("taskDialog.footerHint")),1),p("div",el,[p("button",{type:"button",class:"tool-button px-3 py-2 text-sm",disabled:s.value,onClick:K[16]||(K[16]=T=>n("close"))},A(l(o)("common.cancel")),9,tl),p("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-sm",disabled:s.value||i.value,onClick:me},[s.value?(E(),we(l(Ot),{key:0,class:"h-4 w-4 animate-spin"})):(E(),we(l(Mi),{key:1,class:"h-4 w-4"})),p("span",null,A(s.value?l(o)("common.saving"):l(o)("taskDialog.saveTaskConfig")),1)],8,ul)])])])])):ve("",!0)]))}},rl={key:0,class:"flex items-center gap-2 text-sm"},il={class:"min-w-0 flex-1 truncate"},sl={class:"theme-muted-text ml-2 font-mono text-[11px]"},al={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},ll={key:1,class:"theme-muted-text text-sm"},cl={class:"theme-divider theme-muted-text flex items-center justify-between gap-3 border-b border-dashed px-3 py-2 text-[11px]"},dl=["onClick"],fl={class:"flex items-start gap-3"},pl={class:"min-w-0 flex-1"},hl={class:"flex items-center gap-2 text-sm"},ml={class:"min-w-0 flex-1 truncate"},gl={class:"font-medium text-[var(--theme-textPrimary)]"},bl={class:"theme-muted-text ml-2 font-mono text-[11px]"},xl={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},vl={__name:"CodexSessionSelect",props:{modelValue:{type:String,default:""},sessions:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","refresh-intent"],setup(e,{emit:t}){const u=t,{t:n}=_t();function r(d){return(d==null?void 0:d.title)||n("projectManager.untitledProject")}function o(d){return(d==null?void 0:d.cwd)||n("projectManager.notSet")}function i(d){return d!=null&&d.running?n("projectManager.running"):n("projectManager.idle")}function s(d){return d!=null&&d.running?"theme-status-warning":"theme-status-success"}function a(d){return d?"theme-filter-active":"theme-filter-idle"}return(d,c)=>(E(),we(Kt,{"model-value":e.modelValue,options:e.sessions,loading:e.loading,disabled:e.disabled,placeholder:l(n)("projectManager.selectProject"),"empty-text":l(n)("projectManager.noProjectsInSelect"),"get-option-value":f=>(f==null?void 0:f.id)||"","onUpdate:modelValue":c[0]||(c[0]=f=>u("update:modelValue",f)),onRefreshIntent:c[1]||(c[1]=f=>u("refresh-intent"))},{trigger:Et(({selectedOption:f,disabled:m})=>[f?(E(),O("div",rl,[p("span",il,[p("span",{class:Se(["font-medium",m?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},A(r(f)),3),p("span",sl,A(o(f)),1)]),p("span",al,A(l(Ge)(f.engine)),1),p("span",{class:Se(["inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",s(f)])},A(i(f)),3)])):(E(),O("div",ll,A(e.loading?l(n)("projectManager.syncingProjects"):l(n)("projectManager.selectProject")),1))]),header:Et(()=>[p("div",cl,[p("span",null,A(e.loading?l(n)("projectManager.syncingLatestProjects"):l(n)("projectManager.projectCount",{count:e.sessions.length})),1),e.loading?(E(),we(l(Ot),{key:0,class:"h-3.5 w-3.5 animate-spin"})):ve("",!0)])]),option:Et(({option:f,selected:m,select:_})=>[p("button",{type:"button",class:Se(["w-full rounded-sm border border-dashed p-3 text-left transition",a(m)]),onClick:_},[p("div",fl,[p("div",pl,[p("div",hl,[p("span",ml,[p("span",gl,A(r(f)),1),p("span",bl,A(o(f)),1)]),p("span",xl,A(l(Ge)(f.engine)),1),p("span",{class:Se(["inline-flex items-center rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",s(f)])},A(i(f)),3)])]),m?(E(),we(l(Di),{key:0,class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):ve("",!0)])],10,dl)]),_:1},8,["model-value","options","loading","disabled","placeholder","empty-text","get-option-value"]))}},yl=["disabled"],kl=["disabled"],_l=["src","alt"],Dr={__name:"ImagePreviewOverlay",props:{modelValue:{type:String,default:""},images:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=H(1),i=le(()=>u.images.map(v=>String(v||"").trim()).filter(Boolean)),s=le(()=>i.value.findIndex(v=>v===u.modelValue)),a=le(()=>s.value>=0?i.value[s.value]:"");function d(){n("update:modelValue",""),o.value=1}function c(v){n("update:modelValue",String(v||"").trim()),o.value=1}function f(){s.value<=0||c(i.value[s.value-1])}function m(){s.value<0||s.value>=i.value.length-1||c(i.value[s.value+1])}function _(v){const x=Math.min(3,Math.max(.5,o.value+v));o.value=Math.round(x*100)/100}function g(){o.value=1}function F(v){a.value&&(v.preventDefault(),_(v.deltaY<0?.1:-.1))}function B(v){if(a.value){if(v.key==="Escape"){v.preventDefault(),d();return}if(v.key==="ArrowLeft"){v.preventDefault(),f();return}if(v.key==="ArrowRight"){v.preventDefault(),m();return}if(v.key==="+"||v.key==="="){v.preventDefault(),_(.1);return}if(v.key==="-"){v.preventDefault(),_(-.1);return}v.key==="0"&&(v.preventDefault(),g())}}return Ee(()=>u.modelValue,v=>{v||(o.value=1)}),Ee(i,v=>{if(u.modelValue){if(!v.length){d();return}if(!v.includes(u.modelValue)){const x=Math.min(s.value,v.length-1);c(v[x]||v[0])}}},{immediate:!0}),mu(()=>{window.addEventListener("keydown",B)}),ft(()=>{window.removeEventListener("keydown",B)}),(v,x)=>(E(),we(hu,{to:"body"},[a.value?(E(),O("div",{key:0,class:"image-preview-overlay fixed inset-0 z-50 flex items-center justify-center p-6",onClick:d,onWheel:F},[p("div",{class:"absolute left-4 top-4 flex items-center gap-2",onClick:x[2]||(x[2]=Ve(()=>{},["stop"]))},[p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:x[0]||(x[0]=D=>_(-.1))},A(l(r)("imagePreview.zoomOut")),1),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:g},A(Math.round(o.value*100))+"% ",1),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:x[1]||(x[1]=D=>_(.1))},A(l(r)("imagePreview.zoomIn")),1)]),p("div",{class:"absolute right-4 top-4 flex items-center gap-2",onClick:x[3]||(x[3]=Ve(()=>{},["stop"]))},[p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<=0,onClick:f},A(l(r)("imagePreview.previous")),9,yl),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition disabled:cursor-not-allowed disabled:opacity-40",disabled:s.value<0||s.value>=i.value.length-1,onClick:m},A(l(r)("imagePreview.next")),9,kl),p("button",{type:"button",class:"image-preview-overlay__button rounded-sm border px-3 py-2 text-sm transition",onClick:d},A(l(r)("imagePreview.close")),1)]),p("img",{src:a.value,alt:l(r)("imagePreview.alt"),class:"image-preview-overlay__image max-h-[90vh] max-w-[90vw] object-contain shadow-2xl transition-transform",style:gn({transform:`scale(${o.value})`}),onClick:x[4]||(x[4]=Ve(()=>{},["stop"]))},null,12,_l)],32)):ve("",!0)]))}},Sl=`${mo()}/api/events/stream`,ku=new Set;let cu=null,fn=null;function Qn(){fn&&(window.clearTimeout(fn),fn=null)}function Ir(){cu&&(cu.close(),cu=null)}function wl(e){ku.forEach(t=>{try{t(e)}catch{}})}function Fr(){typeof window>"u"||typeof window.EventSource>"u"||cu||!ku.size||(Qn(),cu=new window.EventSource(Sl),cu.onmessage=e=>{try{const t=JSON.parse(String(e.data||"{}"));if(!(t!=null&&t.type))return;wl(t)}catch{}},cu.onerror=()=>{Ir(),ku.size&&(Qn(),fn=window.setTimeout(()=>{Fr()},1500))})}function Tl(e){return typeof e!="function"?()=>{}:(ku.add(e),Fr(),()=>{ku.delete(e),!ku.size&&(Qn(),Ir())})}const $r=H(0),eo=H(0),pn=H(""),hn=H(0),Mr=wn({}),to=wn({}),uo=wn({}),Ru=new Map;let Bo=!1;const Cl=new Set(["created","updated","deleted","session-linked","session-cleared"]),El=new Set(["completed","error","stopped","interrupted","stop_timeout"]);function Nn(e,t=""){const u=String(t||"").trim();u&&(e[u]=Math.max(0,Number(e[u])||0)+1)}function Al(e={}){const t=String(e.type||"").trim(),u=String(e.reason||"").trim();return{updatesTaskList:t==="runs.changed"||t==="tasks.changed"&&Cl.has(u),updatesSessions:t==="ready"||t==="runs.changed"||t==="sessions.changed",updatesTaskRuns:t==="runs.changed",updatesTaskDiff:t==="runs.changed"||t==="tasks.changed"&&(u==="session-linked"||u==="session-cleared")}}function Dl(e=null,t=null){const u=String((e==null?void 0:e.runId)||"").trim(),n=String((e==null?void 0:e.status)||"").trim(),r=String((t==null?void 0:t.runId)||"").trim(),o=String((t==null?void 0:t.status)||"").trim();return!u||!r||u!==r||!n||n!==o?!1:El.has(o)}function Il(e="",t={}){const u=String(e||"").trim();if(!u)return;const n=Ru.get(u);n!=null&&n.size&&n.forEach(r=>{try{r(t)}catch{}})}function Fl(e={}){const t=String(e.type||"").trim(),u=String(e.taskSlug||"").trim(),n=Al(e);if(t){if(t==="ready"){$r.value+=1,pn.value="",hn.value+=1;return}if(t==="tasks.changed"){pn.value=u,n.updatesTaskList&&(eo.value+=1),n.updatesTaskDiff&&Nn(to,u);return}if(t==="runs.changed"){pn.value=u;const r={runId:String(e.runId||"").trim(),status:String(e.status||"").trim(),sentAt:String(e.sentAt||"").trim()},o=u&&uo[u]||null,i=Dl(o,r);u&&(uo[u]=r),n.updatesTaskList&&!i&&(eo.value+=1),n.updatesSessions&&(hn.value+=1),n.updatesTaskRuns&&Nn(Mr,u),n.updatesTaskDiff&&!i&&Nn(to,u);return}if(t==="sessions.changed"){n.updatesSessions&&(hn.value+=1);return}t==="run.event"&&Il(u,{taskSlug:u,runId:String(e.runId||"").trim(),event:e.event||null})}}function Pr(){Bo||typeof window>"u"||(Tl(e=>{Fl(e)}),Bo=!0)}function $l(e=""){const t=String(e||"").trim();return t?Math.max(0,Number(Mr[t])||0):0}function Ml(e=""){const t=String(e||"").trim();return t?Math.max(0,Number(to[t])||0):0}function Pl(e=""){const t=String(e||"").trim();return t&&uo[t]||null}function Bl(e="",t){const u=String(e||"").trim();if(!u||typeof t!="function")return()=>{};Pr();const n=Ru.get(u)||new Set;return n.add(t),Ru.set(u,n),()=>{const r=Ru.get(u);r&&(r.delete(t),r.size||Ru.delete(u))}}function Br(){return Pr(),{readyVersion:$r,listSyncVersion:eo,listSyncTaskSlug:pn,sessionsSyncVersion:hn,getTaskRunSyncVersion:$l,getTaskRunChange:Pl,getTaskDiffSyncVersion:Ml}}const Rl=new Set(["queued","starting","running","stopping"]);function du(){return Tn()==="en-US"}function P(e,t){return du()?t:e}function Ro(e=""){const t=Date.parse(String(e||""));return Number.isFinite(t)?t:0}function Lo(e=[],t=""){return[...e].sort((u,n)=>{const r=+!!(n!=null&&n.running)-+!!(u!=null&&u.running);if(r)return r;const o=+((n==null?void 0:n.id)===t)-+((u==null?void 0:u.id)===t);if(o)return o;const i=Ro(n.updatedAt)-Ro(u.updatedAt);return i||String(u.title||u.cwd||u.id).localeCompare(String(n.title||n.cwd||n.id),Tn())})}function Ll(e="",t=500){const u=String(e||"").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function On(e=[]){const t=Array.isArray(e)?e:[];return t.length?t.map(u=>`${u.completed?"[x]":"[ ]"} ${u.text||P("未命名任务","Untitled Task")}`).join(`
213
+ `):""}function It(e=0){const t=Number(e||0);return Number.isFinite(t)?t.toLocaleString(Tn()):"0"}function Rr(e=0){const t=Math.max(0,Math.floor(Number(e)||0));if(t<66)return`${t}s`;const u=Math.floor(t/3600),n=Math.floor(t%3600/60),r=t%60;return u>0?du()?`${u}h ${n}m ${r}s`:`${u}小时${n}分${r}秒`:du()?`${n}m ${r}s`:`${n}分${r}秒`}function nt(e="",t=140){const u=String(e||"").replace(/\s+/g," ").trim();return u?u.length<=t?u:`${u.slice(0,t)}...`:""}function Lr(e="",t=[]){const u=t.filter(Boolean);if(!u.length)return"";const n=u.map(r=>`- ${r}`).join(`
214
+ `);return e?`${e}
215
+ ${n}`:n}function Cu(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function no(e=[],t=""){const u=String(t||"").trim();return u&&(Array.isArray(e)?e:[]).find(n=>(n==null?void 0:n.runId)===u)||null}function Nl(e,t,u,n,r){const o=no(e,t);return o?(o.events=[],o.lastEventSeq=0,o.summary=Cu(),((u==null?void 0:u.items)||[]).forEach(i=>{bo(o,i,n,r)}),o.eventCount=Math.max(Math.max(0,Number(o.eventCount)||0),Array.isArray(u==null?void 0:u.items)?u.items.length:0,Math.max(0,Number(o.lastEventSeq)||0)),o.eventsLoaded=!0,o.eventsLoading=!1,o):null}function xn(e={}){return wr(e==null?void 0:e.engine)}function ht(e={}){return Ge(xn(e))}function zu(e=""){return Rl.has(String(e||"").trim())}function go(e=""){const t=String(e||"").trim();if(!t)return null;const u=t.match(/^Reconnecting\.\.\.\s*(\d+)\/(\d+)\s*\(([\s\S]+)\)$/i);return u?{attempt:Number(u[1]||0),total:Number(u[2]||0),reason:String(u[3]||"").trim(),rawMessage:t}:null}function No(e={},t="completed"){const u=e.action||{},n=String(u.type||"").trim(),r=String(e.query||u.query||"").trim(),o=Array.isArray(u.queries)?u.queries.map(s=>String(s||"").trim()).filter(Boolean):[],i=String(u.url||r||"").trim();return n==="search"?{kind:"command",title:t==="started"?P("正在搜索网页","Searching the web"):P("已搜索网页","Web search completed"),detail:Lr(r?P(`关键词:${r}`,`Query: ${r}`):"",o.length>1?o:[])}:n==="open_page"?{kind:"command",title:t==="started"?P("正在打开网页","Opening page"):P("已打开网页","Page opened"),detail:i}:{kind:"command",title:t==="started"?P("准备网页检索","Preparing web search"):P("网页检索已更新","Web search updated"),detail:r}}function Oo(e={},t="completed"){const u=String(e.tool||"").trim(),n=Array.isArray(e.receiver_thread_ids)?e.receiver_thread_ids.filter(Boolean).length:0,r=nt(e.prompt);return u==="spawn_agent"?{kind:"todo",title:t==="started"?P("正在启动子代理","Starting sub-agent"):P(`已启动 ${n||1} 个子代理`,`Started ${n||1} sub-agent(s)`),detail:r?P(`任务:${r}`,`Task: ${r}`):""}:u==="wait"?{kind:"todo",title:t==="started"?n?P(`等待 ${n} 个子代理返回结果`,`Waiting for ${n} sub-agent result(s)`):P("等待子代理返回结果","Waiting for sub-agent results"):P("子代理结果已汇总","Sub-agent results aggregated"),detail:r?P(`等待内容:${r}`,`Waiting on: ${r}`):""}:{kind:"todo",title:t==="started"?P(`正在执行协作工具:${u||"未知工具"}`,`Running collaboration tool: ${u||"Unknown tool"}`):P(`协作工具完成:${u||"未知工具"}`,`Collaboration tool completed: ${u||"Unknown tool"}`),detail:r?P(`任务:${r}`,`Task: ${r}`):""}}function zo(e={},t="completed"){const u=Array.isArray(e.changes)?e.changes:[],n={create:P("新增","Added"),update:P("更新","Updated"),delete:P("删除","Deleted")};return{kind:"command",title:t==="started"?P("正在整理文件变更","Collecting file changes"):P(`已记录 ${u.length||0} 个文件改动`,`Recorded ${u.length||0} file change(s)`),detail:Lr("",u.map(r=>{const o=String((r==null?void 0:r.path)||"").trim();return`${n[String((r==null?void 0:r.kind)||"").trim()]||P("变更","Changed")} ${o||P("未命名文件","Unnamed file")}`}))}}function Ol(e,t={}){var i,s,a,d,c,f,m,_;e!=null&&e.summary||(e.summary=Cu());const u=e.summary,n=ht(e),r=String(t.type||"").trim(),o=t.item||{};if(r===Qe.TURN_STARTED){u.currentActivity=P("正在分析任务","Analyzing task"),u.latestActivity=P(`${n} 开始执行`,`${n} started`),u.latestDetail="";return}if(r===Qe.TURN_COMPLETED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=P(`${n} 执行完成`,`${n} completed`),u.latestDetail="";return}if(r===Qe.TURN_FAILED){u.currentActivity="",u.waitingAgentCount=0,u.latestActivity=P("本轮运行失败","This run failed"),u.latestDetail="";return}if(r===Qe.ERROR){const g=go(qu(t));if(g){u.currentActivity=P(`网络异常,正在重试 (${g.attempt}/${g.total})`,`Network error, retrying (${g.attempt}/${g.total})`),u.latestActivity=u.currentActivity,u.latestDetail=nt(g.reason,120);return}u.currentActivity="",u.latestActivity=P(`${n} 返回错误`,`${n} returned an error`),u.latestDetail=nt(qu(t),120);return}if(r===Qe.ITEM_STARTED){if(o.type===Ne.REASONING){u.currentActivity=P("正在思考","Thinking"),u.latestActivity=P("正在思考","Thinking"),u.latestDetail=nt(o.text,120);return}if(o.type===Ne.COMMAND_EXECUTION){u.currentActivity=P("正在执行命令","Running command"),u.latestActivity=P("开始执行命令","Command started"),u.latestDetail=nt(o.command,120);return}if(o.type===Ne.WEB_SEARCH){u.currentActivity=((i=o.action)==null?void 0:i.type)==="open_page"?P("正在打开网页","Opening page"):P("正在搜索网页","Searching the web"),u.latestActivity=u.currentActivity,u.latestDetail=nt(((s=o.action)==null?void 0:s.type)==="open_page"?((a=o.action)==null?void 0:a.url)||o.query:o.query||((d=o.action)==null?void 0:d.query),120);return}if(o.type===Ne.COLLAB_TOOL_CALL){if(o.tool==="wait"){const g=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.waitingAgentCount=g,u.currentActivity=g?P(`等待 ${g} 个子代理返回结果`,`Waiting for ${g} sub-agent result(s)`):P("等待子代理返回结果","Waiting for sub-agent results"),u.latestActivity=u.currentActivity,u.latestDetail=nt(o.prompt,120);return}if(o.tool==="spawn_agent"){u.currentActivity=P("正在启动子代理","Starting sub-agent"),u.latestActivity=P("正在启动子代理","Starting sub-agent"),u.latestDetail=nt(o.prompt,120);return}}if(o.type===Ne.FILE_CHANGE){u.currentActivity=P("正在整理文件变更","Collecting file changes"),u.latestActivity=P("正在整理文件变更","Collecting file changes"),u.latestDetail=nt((o.changes||[]).map(g=>g==null?void 0:g.path).filter(Boolean).join(du()?", ":","),120);return}o.type===Ne.TODO_LIST&&(u.currentActivity=P("正在规划执行步骤","Planning steps"),u.latestActivity=P("正在规划执行步骤","Planning steps"),u.latestDetail=nt((o.items||[]).map(g=>g==null?void 0:g.text).filter(Boolean).join(du()?"; ":";"),120));return}if(r===Qe.ITEM_COMPLETED){if(o.type===Ne.COMMAND_EXECUTION){u.commandCount+=1,u.currentActivity="",u.latestActivity=P("命令执行完成","Command completed"),u.latestDetail=nt(o.command,120);return}if(o.type===Ne.WEB_SEARCH){u.webSearchCount+=1,u.currentActivity="",u.latestActivity=((c=o.action)==null?void 0:c.type)==="open_page"?P("已打开网页","Page opened"):P("已搜索网页","Web search completed"),u.latestDetail=nt(((f=o.action)==null?void 0:f.type)==="open_page"?((m=o.action)==null?void 0:m.url)||o.query:o.query||((_=o.action)==null?void 0:_.query),120);return}if(o.type===Ne.COLLAB_TOOL_CALL){if(o.tool==="spawn_agent"){const g=Array.isArray(o.receiver_thread_ids)?o.receiver_thread_ids.filter(Boolean).length:0;u.subAgentCount+=g,u.currentActivity="",u.latestActivity=g?P(`已启动 ${g} 个子代理`,`Started ${g} sub-agent(s)`):P("已启动子代理","Started sub-agent"),u.latestDetail=nt(o.prompt,120);return}if(o.tool==="wait"){u.waitingAgentCount=0,u.currentActivity="",u.latestActivity=P("子代理结果已汇总","Sub-agent results aggregated"),u.latestDetail=nt(o.prompt,120);return}u.currentActivity="",u.latestActivity=P(`协作工具完成:${o.tool||"未知工具"}`,`Collaboration tool completed: ${o.tool||"Unknown tool"}`),u.latestDetail=nt(o.prompt,120);return}if(o.type===Ne.FILE_CHANGE){const g=Array.isArray(o.changes)?o.changes:[];u.fileChangeCount+=g.length,u.currentActivity="",u.latestActivity=g.length?P(`已记录 ${g.length} 个文件改动`,`Recorded ${g.length} file change(s)`):P("已记录文件改动","Recorded file changes"),u.latestDetail=nt(g.map(F=>F==null?void 0:F.path).filter(Boolean).join(du()?", ":","),120);return}if(o.type===Ne.TODO_LIST){u.currentActivity="",u.latestActivity=P("待办列表已更新","Todo list updated"),u.latestDetail=nt((o.items||[]).map(g=>g==null?void 0:g.text).filter(Boolean).join(du()?"; ":";"),120);return}o.type===Ne.AGENT_MESSAGE&&(u.currentActivity="",u.latestActivity=P(`${n} 已返回结果`,`${n} returned a result`),u.latestDetail=nt(o.text,120))}}function zl(e={},t={}){const u=Date.parse(String(e.startedAt||""));if(!Number.isFinite(u))return 0;if(zu(e.status)){if(t.currentRunningRunId&&String(t.currentRunningRunId)===String(e.runId||"")&&Number.isFinite(Number(t.runningElapsedSeconds)))return Math.max(0,Math.floor(Number(t.runningElapsedSeconds)||0));const r=Number(t.nowMs)||Date.now();return Math.max(0,Math.floor((r-u)/1e3))}const n=Date.parse(String(e.finishedAt||""));return Number.isFinite(n)&&n>=u?Math.max(0,Math.floor((n-u)/1e3)):0}function Nr(e={},t={}){const u=e.summary||Cu(),n=[],r=zl(e,t);return r>0&&n.push({key:"elapsed",label:P("耗时","Elapsed"),value:Rr(r)}),u.webSearchCount&&n.push({key:"web",label:P("网页","Web"),value:It(u.webSearchCount)}),u.commandCount&&n.push({key:"command",label:P("命令","Command"),value:It(u.commandCount)}),u.fileChangeCount&&n.push({key:"file",label:P("改动","Changes"),value:It(u.fileChangeCount)}),u.subAgentCount&&n.push({key:"agent",label:P("子代理","Sub-agent"),value:It(u.subAgentCount)}),n}function Or(e={}){const t=e.summary||Cu();return t.waitingAgentCount>0?P(`当前:等待 ${It(t.waitingAgentCount)} 个子代理返回结果`,`Current: waiting for ${It(t.waitingAgentCount)} sub-agent result(s)`):t.currentActivity?P(`当前:${t.currentActivity}`,`Current: ${t.currentActivity}`):t.latestActivity?P(`最近:${t.latestActivity}`,`Latest: ${t.latestActivity}`):zu(e.status)?P(`当前:正在等待 ${ht(e)} 返回更多事件`,`Current: waiting for more events from ${ht(e)}`):""}function zr(e={}){const t=e.summary||Cu();return String(t.latestDetail||"").trim()}function ql(e={}){return!!(Nr(e).length||Or(e)||zr(e))}const Ul=[{type:"startup_config",title:e=>P(`${Ge(e)} 启动配置冲突`,`${Ge(e)} startup config conflict`),summary:e=>P(`${Ge(e)} 当前启动参数可能与本机包装脚本、别名或外部环境配置冲突,请检查 CLI 启动方式。`,`${Ge(e)} startup arguments may conflict with your local wrapper script, alias, or external environment configuration. Please check how the CLI is launched.`),patterns:[/not inside a trusted directory/i,/do you trust the contents of this directory/i,/trusted directory/i,/skip-git-repo-check/i,/prompt injection/i,/目录.*信任/,/可信目录/]},{type:"billing",title:P("额度或账单异常","Quota or billing issue"),summary:e=>P(`${Ge(e)} 可能因为额度不足、欠费或账单限制而无法继续执行。`,`${Ge(e)} may be unable to continue due to quota exhaustion, billing issues, or account limits.`),patterns:[/insufficient_quota/i,/exceeded your current quota/i,/\bquota\b/i,/\bbilling\b/i,/credit balance/i,/payment required/i,/余额不足/,/欠费/,/账单/,/充值/]},{type:"permission",title:P("权限不足","Insufficient permissions"),summary:e=>P(`${Ge(e)} 当前权限不够,无法访问所需文件、命令或资源。`,`${Ge(e)} does not currently have permission to access the required files, commands, or resources.`),patterns:[/permission denied/i,/insufficient permissions?/i,/forbidden/i,/unauthorized/i,/access denied/i,/not allowed/i,/权限不足/,/没有权限/,/无权/,/拒绝访问/]},{type:"rate_limit",title:P("请求过于频繁","Too many requests"),summary:e=>P(`${Ge(e)} 可能触发了限流,请稍后再试。`,`${Ge(e)} may have hit a rate limit. Please try again later.`),patterns:[/rate limit/i,/too many requests/i,/\b429\b/,/请求过于频繁/,/限流/]},{type:"context_limit",title:P("上下文过长","Context too long"),summary:P("这次发送的内容可能过长,超过了模型可处理的上下文限制。","The content sent in this run may be too long and exceed the model context limit."),patterns:[/context length/i,/maximum context length/i,/context_length_exceeded/i,/token limit/i,/prompt is too long/i,/上下文过长/,/超过.*token/i,/超出.*上下文/]},{type:"model_unavailable",title:P("模型或服务暂不可用","Model or service unavailable"),summary:e=>P(`${Ge(e)} 背后的模型或服务当前不可用,请稍后重试。`,`The model or service behind ${Ge(e)} is currently unavailable. Please try again later.`),patterns:[/model .*not found/i,/model .*unavailable/i,/service unavailable/i,/server error/i,/overloaded/i,/\b503\b/,/模型不可用/,/服务不可用/]},{type:"network",title:P("网络连接异常","Network connection issue"),summary:e=>P(`${Ge(e)} 在请求过程中遇到了网络问题或连接超时。`,`${Ge(e)} encountered a network problem or timeout while making the request.`),patterns:[/timed out/i,/\btimeout\b/i,/stream disconnected/i,/error sending request/i,/connection reset/i,/connection closed/i,/socket hang up/i,/network error/i,/fetch failed/i,/econnreset/i,/econnrefused/i,/enotfound/i,/network is unreachable/i,/temporary failure in name resolution/i,/网络异常/,/连接超时/]},{type:"cli_missing",title:e=>P(`${Ge(e)} CLI 不可用`,`${Ge(e)} CLI unavailable`),summary:e=>P(`当前环境没有正确安装或配置 ${Ge(e)} CLI。`,`${Ge(e)} CLI is not correctly installed or configured in the current environment.`),patterns:[/找不到 Codex CLI/,/找不到 Claude Code CLI/,/找不到 OpenCode CLI/,/codex --version/i,/claude --version/i,/opencode --version/i,/enoent/i,/not recognized as an internal or external command/i,/command not found/i]}];function Su(e="",t="codex"){const u=String(e||"").trim();if(!u)return null;const n=Ul.find(r=>r.patterns.some(o=>o.test(u)));return n?{type:n.type,title:typeof n.title=="function"?n.title(t):n.title,summary:typeof n.summary=="function"?n.summary(t):n.summary,rawMessage:u}:null}function pu(e="",t="codex"){const u=String(e||"").trim();if(!u)return"";const n=Su(u,t);return n?`${n.summary}
216
+
217
+ ${P("原始错误","Raw error")}: ${n.rawMessage}`:u}function oo(e,t=0){if(!e||t>4)return"";if(typeof e=="string")return e.trim();if(typeof e!="object")return"";const u=["message","detail","error","last_error","cause","reason","stderr","text","summary"];for(const n of u){if(!Object.prototype.hasOwnProperty.call(e,n))continue;const r=oo(e[n],t+1);if(r)return r}for(const n of Object.values(e)){const r=oo(n,t+1);if(r)return r}return""}function qu(e={}){return oo(e)}function jl(e={},t="Codex",u="codex"){const n=String(e.type||"").trim(),r=e.item||{};if(!n)return{title:P(`收到 ${t} 事件`,`Received ${t} event`),detail:""};if(n===Qe.THREAD_STARTED)return{title:P(`${t} 会话已创建`,`${t} session created`),detail:e.thread_id?P(`线程 ID: ${e.thread_id}`,`Thread ID: ${e.thread_id}`):""};if(n===Qe.TURN_STARTED)return{title:P(`${t} 开始执行`,`${t} started`),detail:""};if(n===Qe.TURN_COMPLETED){const o=e.usage?[P(`输入 ${It(e.usage.input_tokens)}`,`Input ${It(e.usage.input_tokens)}`),e.usage.cached_input_tokens?P(`缓存 ${It(e.usage.cached_input_tokens)}`,`Cached ${It(e.usage.cached_input_tokens)}`):"",P(`输出 ${It(e.usage.output_tokens)}`,`Output ${It(e.usage.output_tokens)}`)].filter(Boolean).join(" / "):"";return{title:P(`${t} 执行完成`,`${t} completed`),detail:o}}if(n===Qe.ERROR||n===Qe.TURN_FAILED){const o=qu(e)||P(`${t} 执行失败`,`${t} failed`),i=n===Qe.ERROR?go(o):null;if(i)return{kind:"info",title:P(`网络异常,正在重试 (${i.attempt}/${i.total})`,`Network error, retrying (${i.attempt}/${i.total})`),detail:pu(i.reason||i.rawMessage,u)};const s=Su(o,u);return{kind:"error",title:(s==null?void 0:s.title)||(n===Qe.TURN_FAILED?P("本轮运行失败","This run failed"):P(`${t} 返回错误`,`${t} returned an error`)),detail:pu(o,u)}}if(n===Qe.ITEM_STARTED)return r.type===Ne.REASONING?{kind:"info",title:P("正在思考","Thinking"),detail:r.text||""}:r.type===Ne.WEB_SEARCH?No(r,"started"):r.type===Ne.COLLAB_TOOL_CALL?Oo(r,"started"):r.type===Ne.FILE_CHANGE?zo(r,"started"):r.type===Ne.COMMAND_EXECUTION?{kind:"command",title:P("开始执行命令","Command started"),detail:r.command||""}:r.type===Ne.TODO_LIST?{kind:"todo",title:P("更新待办列表","Update todo list"),detail:On(r.items)}:{title:P(`开始处理 ${r.type||"未知项目"}`,`Started handling ${r.type||"unknown item"}`),detail:""};if(n===Qe.ITEM_UPDATED&&r.type===Ne.TODO_LIST)return{kind:"todo",title:P("更新待办列表","Update todo list"),detail:On(r.items)};if(n===Qe.ITEM_COMPLETED){if(r.type===Ne.AGENT_MESSAGE&&r.text)return{kind:"result",title:P(`${t} 已返回结果`,`${t} returned a result`),detail:""};if(r.type===Ne.WEB_SEARCH)return No(r,"completed");if(r.type===Ne.COLLAB_TOOL_CALL)return Oo(r,"completed");if(r.type===Ne.FILE_CHANGE)return zo(r,"completed");if(r.type===Ne.COMMAND_EXECUTION){const o=r.exit_code===0||r.status==="completed";return{kind:o?"command":"error",title:o?P("命令执行完成","Command completed"):P(`命令执行失败(exit ${r.exit_code??"?"})`,`Command failed (exit ${r.exit_code??"?"})`),detail:[r.command,Ll(r.aggregated_output)].filter(Boolean).join(`
218
+
219
+ `)}}return r.type===Ne.TODO_LIST?{kind:"todo",title:P("更新待办列表","Update todo list"),detail:On(r.items)}:{title:P(`完成 ${r.type||"未知项目"}`,`Completed ${r.type||"unknown item"}`),detail:""}}return{title:P(`事件: ${n}`,`Event: ${n}`),detail:""}}function Vl(e){return e.status==="queued"?P("排队中","Queued"):e.status==="starting"?P("启动中","Starting"):e.status==="stopping"?P("停止中","Stopping"):e.status==="running"?P("进行中","Running"):e.status==="error"?P("失败","Failed"):e.status==="interrupted"?P("已中断","Interrupted"):e.status==="stopped"?P("已停止","Stopped"):e.status==="stop_timeout"?P("停止超时","Stop timeout"):P("已完成","Completed")}function qr(e={},t){if(typeof e=="string"){const r=e.trim();return r?{id:t(),kind:"info",title:r,detail:""}:null}const u=String(e.title||"").trim(),n=String(e.detail||"").trim();return!u&&!n?null:{id:t(),kind:e.kind||"info",title:u||n,detail:u?n:""}}function Hl(e={},t){const u=Array.isArray(e.promptBlocks)?e.promptBlocks.map(n=>({...n,meta:n!=null&&n.meta?{...n.meta}:{},content:(n==null?void 0:n.type)==="image"?dn(n.content):n.content})):[];return{id:t(),runId:String(e.id||"").trim(),engine:xn(e),prompt:String(e.prompt||"").trim(),promptBlocks:u,status:"completed",startedAt:e.startedAt||e.createdAt||"",finishedAt:e.finishedAt||"",events:[],eventCount:Math.max(0,Number(e.eventCount)||(Array.isArray(e.events)?e.events.length:0)),eventsLoaded:!!e.eventsIncluded,eventsLoading:!1,responseMessage:"",errorMessage:"",lastEventSeq:0,summary:Cu()}}function Wt(e,t,u){const n=qr(t,u);n&&(e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120))}function Wl(e,t,u){var r;const n=qr(t,u);if(n){for(let o=e.events.length-1;o>=0;o-=1){const i=P("网络异常,正在重试","Network error, retrying");if(String(((r=e.events[o])==null?void 0:r.title)||"").startsWith(i)){e.events.splice(o,1,n);return}}e.events.push(n),e.events.length>120&&e.events.splice(0,e.events.length-120)}}function Kl(e,t={},u,n=()=>{}){var o,i,s,a,d,c,f,m,_,g,F,B;const r=_r(t.type);if(r===Ct.SESSION){n(t.session),e.engine=xn(t.session||e),Wt(e,{title:P(`已连接项目:${((o=t.session)==null?void 0:o.title)||"未命名项目"}`,`Connected project: ${((i=t.session)==null?void 0:i.title)||"Untitled Project"}`),detail:(s=t.session)!=null&&s.cwd?P(`工作目录:${t.session.cwd}`,`Working directory: ${t.session.cwd}`):""},u);return}if(r===Ct.SESSION_UPDATED){n(t.session),e.engine=xn(t.session||e),Wt(e,{title:P("项目会话已更新","Project session updated"),detail:(a=t.session)!=null&&a.started?P("后续请求会继续复用当前项目的执行引擎会话。","Subsequent requests will continue reusing the current engine session for this project."):""},u);return}if(r===Ct.STATUS){if(t.stage==="starting"||t.stage==="resuming")return;Wt(e,{title:t.message||P("状态已更新","Status updated"),detail:""},u);return}if(r===Ct.STDERR){const v=Su(t.text,e.engine);Wt(e,{kind:"error",title:(v==null?void 0:v.title)||"stderr",detail:pu(t.text,e.engine)},u);return}if(r===Ct.STDOUT){Wt(e,{kind:"command",title:"stdout",detail:t.text},u);return}if(r===Ct.AGENT_EVENT){Ol(e,t.event);const v=jl(t.event,ht(e),e.engine);String(v.title||"").startsWith(P("网络异常,正在重试","Network error, retrying"))?Wl(e,v,u):Wt(e,v,u),((d=t.event)==null?void 0:d.type)===Qe.ITEM_COMPLETED&&((f=(c=t.event)==null?void 0:c.item)==null?void 0:f.type)===Ne.AGENT_MESSAGE&&((_=(m=t.event)==null?void 0:m.item)!=null&&_.text)&&(e.responseMessage=t.event.item.text);const x=qu(t.event)||P(`${ht(e)} 执行失败`,`${ht(e)} failed`);if(!(((g=t.event)==null?void 0:g.type)==="error"?go(x):null)&&(((F=t.event)==null?void 0:F.type)===Qe.ERROR||((B=t.event)==null?void 0:B.type)===Qe.TURN_FAILED)){const L=qu(t.event)||P(`${ht(e)} 执行失败`,`${ht(e)} failed`);e.errorMessage=pu(L,e.engine),e.status="error"}return}if(r===Ct.COMPLETED){Wt(e,{kind:"result",title:P("本轮执行结束","Run finished"),detail:""},u),t.message&&(e.responseMessage=t.message);return}if(r===Ct.STOPPED){Wt(e,{title:t.message||P("执行已手动停止","Execution stopped manually"),detail:""},u);return}if(r===Ct.ERROR){const v=Su(t.message,e.engine);Wt(e,{kind:"error",title:(v==null?void 0:v.title)||P("执行失败","Execution failed"),detail:pu(t.message||P(`${ht(e)} 执行失败`,`${ht(e)} failed`),e.engine)},u)}}function Gl(e="",t="",u="codex"){const n=String(e||"").trim(),r=String(t||"").trim();if(!r)return!1;if(!n||/no last agent message|wrote empty content/i.test(n)||/执行失败[。.]?$/i.test(n))return!0;const o=Su(n,u),i=Su(r,u);return!o&&!!i}function Zl(e,t={}){e.status=t.status||"completed",e.responseMessage=String(t.responseMessage||e.responseMessage||""),e.finishedAt=String(t.finishedAt||e.finishedAt||"");const u=pu(String(t.errorMessage||""),e.engine),n=String(e.errorMessage||"");return e.errorMessage=Gl(t.errorMessage,n,e.engine)?n:u,e.status==="completed"&&!e.responseMessage&&(e.responseMessage=P(`本轮 ${ht(e)} 执行已完成,没有返回额外文本。`,`${ht(e)} completed in this run without returning additional text.`)),e}function bo(e,t={},u,n=()=>{}){const r=Math.max(0,Number(t==null?void 0:t.seq)||0);if(r&&r<=Number(e.lastEventSeq||0))return!1;const o=(t==null?void 0:t.payload)||{};Kl(e,o,u,n);const i=_r(o.type);return i===Ct.COMPLETED?(e.status="completed",e.finishedAt=new Date().toISOString()):i===Ct.STOPPED?(e.status="stopped",e.errorMessage="",e.finishedAt=new Date().toISOString()):i===Ct.ERROR&&(e.status="error",e.errorMessage=pu(String(o.message||e.errorMessage||P(`${ht(e)} 执行失败`,`${ht(e)} failed`)),e.engine),e.finishedAt=new Date().toISOString()),r&&(e.lastEventSeq=r),e.eventCount=Math.max(Math.max(0,Number(e.eventCount)||0),r,Array.isArray(e.events)?e.events.length:0),(r||Array.isArray(e.events)&&e.events.length)&&(e.eventsLoaded=!0),!0}function qo(e,t,u,n){const r=Hl(e,t);return(e.events||[]).forEach(o=>{bo(r,o,u,n)}),Zl(r,e)}const Xl=1800,Yl=7200;function Jl(){return{commandCount:0,webSearchCount:0,fileChangeCount:0,subAgentCount:0,waitingAgentCount:0,currentActivity:"",latestActivity:"",latestDetail:""}}function Ql(e={}){const{props:t,turns:u,sessions:n,sending:r,sendingStartedAt:o,currentRunningRunId:i,sessionError:s,supportsServerEvents:a,scheduleScrollToBottom:d,resetAutoStickToBottom:c,mergeSessionRecord:f,mergeSession:m,loadSessions:_}=e;let g=0,F=0,B=null,v="",x=null,D="",L=0;const $=new Map;function te(){return g+=1,g}function C(){return F+=1,F}function Q(){x&&(window.clearInterval(x),x=null)}function Y(){L=Date.now()}function N(){$.clear(),u.value=[],r.value=!1,o.value=0,i.value="",D="",v="",g=0,F=0,c()}function q(){const U=[...u.value].reverse().find(W=>zu(W.status))||null;if(i.value=(U==null?void 0:U.runId)||"",r.value=!!U,U!=null&&U.startedAt){const W=Date.parse(String(U.startedAt||""));o.value=Number.isFinite(W)?W:Date.now();return}o.value=0}function ue(U=null){return U?{...U}:Jl()}function ae(U,W=null){if(!(W!=null&&W.runId)||U.eventsLoaded||!W.eventsLoaded)return $.has(U.runId)&&(U.eventsLoading=!0),U;const J=Math.max(Math.max(0,Number(W.lastEventSeq)||0),Math.max(0,Number(W.eventCount)||0),Array.isArray(W.events)?W.events.length:0),ge=Math.max(0,Number(U.eventCount)||0);return J<ge?($.has(U.runId)&&(U.eventsLoading=!0),U):(U.events=Array.isArray(W.events)?[...W.events]:[],U.eventCount=Math.max(Math.max(0,Number(U.eventCount)||0),Math.max(0,Number(W.eventCount)||0),U.events.length),U.eventsLoaded=!0,U.eventsLoading=$.has(U.runId),U.lastEventSeq=Math.max(0,Number(W.lastEventSeq)||0),U.summary=ue(W.summary),U)}function me(U,W){const J=no(u.value,U);return J?(J.eventsLoading=!!W,u.value=[...u.value],J):null}async function ce(U,W={}){const J=String((U==null?void 0:U.runId)||"").trim(),{force:ge=!1}=W;if(!J)return[];const oe=no(u.value,J)||U;if(oe!=null&&oe.eventsLoaded&&!ge)return oe.events;if($.has(J))return $.get(J);me(J,!0);const Ie=(async()=>{var _e;try{const Me=await Ls(J,{limit:5e3}),$e=Nl(u.value,J,Me,C,fe=>{m(fe,{preserveRunning:!0})});return $e?(u.value=[...u.value],t.active&&((_e=u.value.at(-1))==null?void 0:_e.runId)===J&&d(),$e.events):Array.isArray(oe==null?void 0:oe.events)?oe.events:[]}catch(Me){throw s.value=Me.message,Me}finally{me(J,!1),$.delete(J)}})();return $.set(J,Ie),Ie}function ye(U,W){const J=String(U||"").trim();if(!J||!W)return!1;const ge=u.value.findIndex(_e=>_e.runId===J);if(ge<0)return!1;const oe=u.value[ge];return bo(oe,W,C,_e=>{m(_e,{preserveRunning:!0})})&&(u.value=[...u.value],q(),d()),!0}function j(){Q(),!(a||!t.active||!r.value||!t.taskSlug)&&(x=window.setInterval(()=>{T({force:!0}).catch(()=>{});const U=Date.now();U-L<Yl||(L=U,_({force:!0}).catch(()=>{}))},Xl))}function K(U=[]){const W=[...n.value],J=new Map(u.value.filter(oe=>String((oe==null?void 0:oe.runId)||"").trim()).map(oe=>[String(oe.runId||"").trim(),oe])),ge=oe=>{if(!(oe!=null&&oe.id))return;const Ie=W.findIndex(_e=>_e.id===oe.id);Ie>=0?W[Ie]=f(W[Ie],oe,{preserveRunning:!0}):W.unshift(f(null,oe,{preserveRunning:!0}))};g=0,F=0,u.value=[...U||[]].reverse().map(oe=>{const Ie=qo(oe,te,C,ge);return ae(Ie,J.get(String((oe==null?void 0:oe.id)||"").trim())||null)}),n.value=W,q()}async function T(U={}){const{force:W=!1,scrollToLatest:J=!1}=U,ge=String(t.taskSlug||"").trim();if(!(!ge||!t.active&&!W))return B&&v===ge||B&&!W||(v=ge,B=(async()=>{try{const Ie=(await Rs(ge,{limit:30,events:"latest"})).items||[],_e=JSON.stringify(Ie.map(fe=>({id:fe.id,status:fe.status,updatedAt:fe.updatedAt,eventCount:Math.max(0,Number(fe.eventCount)||0)}))),Me=J||D&&_e!==D;K(Ie),D=_e,j();const $e=u.value.at(-1)||null;$e!=null&&$e.runId&&!$e.eventsLoaded&&ce($e).catch(()=>{}),Me&&d()}catch(oe){s.value=oe.message}finally{B=null,v=""}})()),B}function X(U={}){const W=(U==null?void 0:U.run)||null,J=(U==null?void 0:U.session)||null;if(J&&m(J,{preserveRunning:!0}),!(W!=null&&W.id)){q(),d({force:!0});return}const oe=qo(W,te,C,_e=>{m(_e,{preserveRunning:!0})}),Ie=u.value.findIndex(_e=>_e.runId===oe.runId);if(Ie>=0){const _e=[...u.value];_e.splice(Ie,1,oe),u.value=_e}else u.value=[...u.value,oe];q(),d({force:!0})}async function de(){if(!(!t.taskSlug||r.value))try{await Os(t.taskSlug),N(),d({force:!0})}catch(U){s.value=U.message}}return{applyCreatedRun:X,applyIncomingRunEvent:ye,clearRunPollTimer:Q,clearTurns:de,loadTurnEvents:ce,markFallbackSessionPollNow:Y,refreshRunHistory:T,resetRunHistoryState:N,syncRunningStateFromTurns:q,updatePollingState:j}}const ec=1500,tc=3e4;function uc(e={}){const{props:t,sessions:u,workspaces:n,loading:r,managerBusy:o,sending:i,stopping:s,sessionError:a,showManager:d,selectedSessionId:c,currentRunningRunId:f,supportsServerEvents:m,mergeSession:_,applyCreatedRun:g,refreshRunHistory:F,markFallbackSessionPollNow:B}=e;let v=null,x=null,D=0,L=0;const $=le(()=>typeof t.buildPrompt=="function"||!!String(t.prompt||"").trim()),te=le(()=>u.value.length>0),C=le(()=>Lo(u.value,c.value)),Q=le(()=>te.value?"":Re("projectManager.noProjects"));async function Y(U={}){const{force:W=!1}=U;if(v)return v;const J=Date.now();return!W&&D&&J-D<ec?{items:u.value,workspaces:n.value}:(v=(async()=>{r.value=!0,a.value="";try{const oe=(await As()).items||[];return u.value=oe,D=Date.now(),{items:oe,workspaces:n.value}}catch(ge){throw a.value=ge.message,ge}finally{r.value=!1,v=null}})(),v)}async function N(U={}){const{force:W=!1}=U;if(x)return x;const J=Date.now();return!W&&L&&J-L<tc?{items:n.value}:(x=(async()=>{try{const ge=await Ds();return n.value=ge.items||[],L=Date.now(),{items:n.value}}finally{x=null}})(),x)}async function q(U={}){const{forceSessions:W=!1,forceWorkspaces:J=!1}=U,[ge,oe]=await Promise.all([Y({force:W}),N({force:J})]);return{items:(ge==null?void 0:ge.items)||u.value,workspaces:(oe==null?void 0:oe.items)||n.value}}function ue(U=""){const W=String(U||"").trim();!W||n.value.includes(W)||(n.value=[W,...n.value])}function ae(){d.value=!0,N().catch(()=>{})}function me(){d.value=!1}function ce(U){const W=String(U||"").trim();if(t.sessionSelectionLocked&&W&&W!==c.value){a.value=t.sessionSelectionLockReason||Re("taskActions.sessionLocked");return}c.value=W}function ye(){q({forceSessions:!0,forceWorkspaces:!0}).catch(()=>{})}async function j(U){o.value=!0,a.value="";try{const W=await Is(U);return _(W),ue(W.cwd),c.value=W.id,W}catch(W){throw a.value=W.message,W}finally{o.value=!1}}async function K(U,W){o.value=!0,a.value="";try{const J=await Fs(U,W);return _(J),ue(J.cwd),J}catch(J){throw a.value=J.message,J}finally{o.value=!1}}async function T(U){var J;const W=String(U||"").trim();if(!W)return{deletedSessionId:"",selectedSessionId:c.value};o.value=!0,a.value="";try{await $s(W);const ge=u.value.filter(Ie=>Ie.id!==W);u.value=ge;let oe=c.value;return c.value===W&&(oe=((J=Lo(ge,"")[0])==null?void 0:J.id)||"",c.value=oe),{deletedSessionId:W,selectedSessionId:oe}}catch(ge){throw a.value=ge.message,ge}finally{o.value=!1}}async function X(){if(!t.taskSlug||!$.value||i.value||s.value)return!1;if(!c.value)return ae(),a.value=Re("projectManager.selectProject"),!1;a.value="";try{await q({forceSessions:!0});const U=u.value.find(oe=>oe.id===c.value)||null;if(!U)return a.value=Re("projectManager.projectMissing"),!1;if(U.running)return a.value=Re("sessionTurns.currentProjectRunning"),!1;const W=typeof t.buildPrompt=="function"?await t.buildPrompt():t.prompt,J=typeof t.buildPromptBlocks=="function"?await t.buildPromptBlocks():[];if(!String(W||"").trim())return a.value=Re("sessionTurns.noPromptToSend"),!1;const ge=await Ns(t.taskSlug,{sessionId:c.value,prompt:W,promptBlocks:J});return g(ge),typeof t.afterSend=="function"&&Promise.resolve(t.afterSend()).catch(oe=>{console.error("[promptx] afterSend failed",oe)}),m||(B(),Promise.all([F({force:!0}),Y({force:!0})]).catch(oe=>{a.value=oe.message})),!0}catch(U){return a.value=U.message,!1}}async function de(){if(!(!f.value||s.value))try{s.value=!0,await zs(f.value),m||(B(),await Promise.all([F({force:!0}),Y({force:!0})]))}catch(U){s.value=!1,a.value=U.message}}return{closeManager:me,handleCreateSession:j,handleDeleteSession:T,handleSelectSession:ce,handleSend:X,handleUpdateSession:K,hasPrompt:$,helperText:Q,loadSessions:Y,loadSessionResources:q,loadWorkspaces:N,openManager:ae,refreshSessionsForSelection:ye,sortedSessions:C,stopSending:de}}function nc(e={}){const{transcriptRef:t,hasNewerMessages:u,threshold:n=48}=e;let r=0,o=[],i=!1,s=!1,a=0,d=!0;function c(){if(typeof window>"u"||!o.length){o=[];return}o.forEach(Y=>{window.cancelAnimationFrame(Y)}),o=[]}function f(){r+=1,c()}function m(Y){s=!!Y,(u==null?void 0:u.value)!==void 0&&(u.value=s)}function _(){i=!1,a+=1,d=!0,m(!1)}function g(Y=t==null?void 0:t.value){return Y?Y.scrollHeight-Y.scrollTop-Y.clientHeight<=n:!0}function F(){return d&&!i}function B(){d&&!i&&m(!1)}function v(){if(d=g(),!d){f();return}B()}function x(){a+=1,i=!0,f()}function D(){const Y=a+1;a=Y,De(()=>{Y===a&&requestAnimationFrame(()=>{Y===a&&(i=!1,d=g(),B())})})}function L(){i=!0,f()}function $(){D()}function te(Y={}){const{force:N=!1}=Y;N&&_(),f();const q=r;De(()=>{if(!(t==null?void 0:t.value)||q!==r)return;if(!N&&!F()){m(!0);return}const ae=()=>{const ce=t==null?void 0:t.value;!ce||q!==r||(ce.scrollTop=ce.scrollHeight,d=!0,m(!1))};ae(),o=[requestAnimationFrame(()=>{ae(),o=[requestAnimationFrame(ae)]})]})}function C(){te({force:!0})}function Q(){a+=1,f()}return{cancelScheduledScrollToBottom:f,destroy:Q,handleTranscriptScroll:v,handleTranscriptTouchEnd:$,handleTranscriptTouchMove:L,handleTranscriptTouchStart:x,isTranscriptNearBottom:g,resetAutoStickToBottom:_,scheduleScrollToBottom:te,scrollToBottom:C}}const oc=150;function rc(e,t){const u=Br(),n=H([]),r=H([]),o=H(!1),i=H(!1),s=H(!1),a=H(!1),d=H(""),c=H([]),f=H(null),m=H(0),_=H(0),g=H(!1),F=H(""),B=H(!1),v=typeof window<"u"&&typeof window.EventSource<"u";let x=null,D=null,L=null,$={sessions:!1,runs:!1};const te=le({get(){return String(e.selectedSessionId||"").trim()},set(y){t("selected-session-change",String(y||"").trim())}}),C=le(()=>a.value?Re("sessionPanel.stopping"):`${Re("projectManager.running")} (${Rr(_.value)})`),{destroy:Q,handleTranscriptScroll:Y,handleTranscriptTouchEnd:N,handleTranscriptTouchMove:q,handleTranscriptTouchStart:ue,resetAutoStickToBottom:ae,scheduleScrollToBottom:me,scrollToBottom:ce}=nc({transcriptRef:f,hasNewerMessages:B});function ye(y,be,ze={}){const{preserveRunning:We=!1}=ze;return be!=null&&be.id?We?{...be,running:!!(y!=null&&y.running)}:be:y||null}function j(y,be={}){if(!(y!=null&&y.id))return;const ze=[...n.value],We=ze.findIndex(wt=>wt.id===y.id);We>=0?ze[We]=ye(ze[We],y,be):ze.unshift(ye(null,y,be)),n.value=ze}const{applyCreatedRun:K,applyIncomingRunEvent:T,clearRunPollTimer:X,clearTurns:de,loadTurnEvents:U,markFallbackSessionPollNow:W,refreshRunHistory:J,resetRunHistoryState:ge,updatePollingState:oe}=Ql({props:e,turns:c,sessions:n,sending:s,sendingStartedAt:m,currentRunningRunId:F,sessionError:d,supportsServerEvents:v,scheduleScrollToBottom:me,resetAutoStickToBottom:ae,mergeSessionRecord:ye,mergeSession:j,loadSessions:(...y)=>Be(...y)}),{closeManager:Ie,handleCreateSession:_e,handleDeleteSession:Me,handleSelectSession:$e,handleSend:fe,handleUpdateSession:Ze,helperText:Ye,loadSessions:Be,loadSessionResources:Le,loadWorkspaces:it,openManager:Xe,refreshSessionsForSelection:St,sortedSessions:gt,stopSending:et}=uc({props:e,sessions:n,workspaces:r,loading:o,managerBusy:i,sending:s,stopping:a,sessionError:d,showManager:g,selectedSessionId:te,currentRunningRunId:F,supportsServerEvents:v,mergeSession:j,applyCreatedRun:K,refreshRunHistory:J,markFallbackSessionPollNow:W});function st(){x&&(window.clearInterval(x),x=null)}function lt(){st(),m.value||(m.value=Date.now()),_.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3)),x=window.setInterval(()=>{_.value=Math.max(0,Math.floor((Date.now()-m.value)/1e3))},1e3)}function bt(){L&&(window.clearTimeout(L),L=null)}function xt(){bt();const y=$;$={sessions:!1,runs:!1},y.sessions&&Be({force:!0}).catch(()=>{}),y.runs&&J({force:!0}).catch(()=>{})}function Ke(y={}){typeof window>"u"||($={sessions:$.sessions||!!y.sessions,runs:$.runs||!!y.runs},!(L||!$.sessions&&!$.runs)&&(L=window.setTimeout(()=>{xt()},oc)))}function ct(y){return Nr(y,{currentRunningRunId:F.value,runningElapsedSeconds:_.value,nowMs:Date.now()})}function qe(y=""){if(!y)return"";const be=new Date(y);return Number.isNaN(be.getTime())?"":be.toLocaleTimeString(Tn(),{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Te(y){return y.status==="error"||y.status==="stop_timeout"?"theme-process-error":y.status==="interrupted"||y.status==="stopped"?"theme-process-stopped":y.status==="completed"?"theme-process-completed":"theme-process-running"}function xe(y){return!!(y.responseMessage||y.errorMessage||y.status==="completed")}return Ee(s,y=>{y?(m.value||(m.value=Date.now()),lt()):(st(),m.value=0,_.value=0,a.value=!1),oe(),t("sending-change",y)},{immediate:!0}),Ee(()=>!!e.taskRunning,y=>{!e.active||y||!s.value||Ke({sessions:!0,runs:!0})}),Ee(()=>e.active,y=>{if(y){Le({forceSessions:!0}).catch(()=>{});return}bt(),X()},{immediate:!0}),Ee(()=>e.taskSlug,()=>{ge(),g.value=!1,d.value="",e.active&&J({force:!0,scrollToLatest:!0}).catch(()=>{})},{immediate:!0}),ft(()=>{st(),X(),bt(),Q(),D==null||D()}),Ee(()=>u.readyVersion.value,()=>{const y=String(e.taskSlug||"").trim();!e.active&&!g.value||(g.value&&it().catch(()=>{}),Ke({sessions:!0,runs:!!y}))}),Ee(()=>u.sessionsSyncVersion.value,()=>{!e.active&&!g.value||Ke({sessions:!0})}),Ee(()=>u.getTaskRunSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||Ke({sessions:!0,runs:!0})}),Ee(()=>String(e.taskSlug||"").trim(),y=>{D==null||D(),D=null,y&&(D=Bl(y,({runId:be,event:ze})=>{if(!e.active)return;T(be,ze)||Ke({sessions:!0,runs:!0})}))},{immediate:!0}),{clearTurns:de,closeManager:Ie,formatTurnTime:qe,getProcessCardClass:Te,getProcessStatus:Vl,getTurnAgentLabel:ht,getTurnSummaryDetail:zr,getDisplayTurnSummaryItems:ct,getTurnSummaryStatus:Or,handleCreateSession:_e,handleDeleteSession:Me,handleSelectSession:$e,handleSend:fe,handleUpdateSession:Ze,loadTurnEvents:U,hasTurnSummary:ql,helperText:Ye,loading:o,managerBusy:i,openManager:Xe,refreshSessionsForSelection:St,selectedSessionId:te,sending:s,stopping:a,sessionError:d,shouldShowResponse:xe,showManager:g,sortedSessions:gt,stopSending:et,hasNewerMessages:B,transcriptRef:f,turns:c,workspaces:r,workingLabel:C,sessions:n,loadSessions:Be,handleTranscriptScroll:Y,handleTranscriptTouchEnd:N,handleTranscriptTouchMove:q,handleTranscriptTouchStart:ue,scrollToBottom:ce}}const ic=8,sc=320,ac=10,lc=400;function Uo(e,t,u){const n=String(e||"").trimEnd();return n?n.split(/\r?\n/).length>t||n.length>u:!1}function cc(e={}){const{turns:t,loadTurnEvents:u}=e,n=H({}),r=H({}),o=H({});function i(C){return String((C==null?void 0:C.runId)||(C==null?void 0:C.id)||"").trim()}function s(C){const Q=i(C);return!!Q&&Q===i(t.value.at(-1))}function a(C){return Math.max(Math.max(0,Number(C==null?void 0:C.eventCount)||0),Array.isArray(C==null?void 0:C.events)?C.events.length:0)}function d(C){return!zu(C==null?void 0:C.status)&&!s(C)&&a(C)>3}function c(C){return Uo(C==null?void 0:C.prompt,ic,sc)}function f(C){return!zu(C==null?void 0:C.status)&&!s(C)&&c(C)}function m(C){return String((C==null?void 0:C.errorMessage)||(C==null?void 0:C.responseMessage)||"")}function _(C){return Uo(m(C),ac,lc)}function g(C){return!(C!=null&&C.errorMessage)&&!s(C)&&_(C)}function F(C){return a(C)>0}function B(C=[]){const Q=new Set((C||[]).map(q=>i(q)).filter(Boolean));n.value=Object.fromEntries(Object.entries(n.value).filter(([q])=>Q.has(q))),r.value=Object.fromEntries(Object.entries(r.value).filter(([q])=>Q.has(q))),o.value=Object.fromEntries(Object.entries(o.value).filter(([q])=>Q.has(q)));const Y=(C||[]).at(-1)||null,N=i(Y);N&&(Object.prototype.hasOwnProperty.call(n.value,N)||(n.value={...n.value,[N]:!1}),Object.prototype.hasOwnProperty.call(r.value,N)||(r.value={...r.value,[N]:!1}),Object.prototype.hasOwnProperty.call(o.value,N)||(o.value={...o.value,[N]:!1}))}function v(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(n.value,Q)?!!n.value[Q]:d(C):!1}async function x(C){const Q=i(C);if(!Q)return;const Y=!v(C);n.value={...n.value,[Q]:Y},!Y&&F(C)&&!C.eventsLoaded&&!C.eventsLoading&&await u(C).catch(()=>{})}function D(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(r.value,Q)?!!r.value[Q]:f(C):!1}function L(C){const Q=i(C);!Q||!c(C)||(r.value={...r.value,[Q]:!D(C)})}function $(C){const Q=i(C);return Q?Object.prototype.hasOwnProperty.call(o.value,Q)?!!o.value[Q]:g(C):!1}function te(C){const Q=i(C);!Q||!_(C)||(o.value={...o.value,[Q]:!$(C)})}return Ee(t,C=>{B(C)},{immediate:!0,deep:!0}),{canCollapsePrompt:c,canCollapseResponse:_,getTurnEventCollapseKey:i,getTurnEventCount:a,hasTurnEventHistory:F,isLatestTurn:s,isPromptCollapsed:D,isResponseCollapsed:$,isTurnEventsCollapsed:v,togglePrompt:L,toggleResponse:te,toggleTurnEvents:x}}const jo={};function dc(e){let t=jo[e];if(t)return t;t=jo[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);t.push(n)}for(let u=0;u<e.length;u++){const n=e.charCodeAt(u);t[n]="%"+("0"+n.toString(16).toUpperCase()).slice(-2)}return t}function wu(e,t){typeof t!="string"&&(t=wu.defaultChars);const u=dc(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(n){let r="";for(let o=0,i=n.length;o<i;o+=3){const s=parseInt(n.slice(o+1,o+3),16);if(s<128){r+=u[s];continue}if((s&224)===192&&o+3<i){const a=parseInt(n.slice(o+4,o+6),16);if((a&192)===128){const d=s<<6&1984|a&63;d<128?r+="��":r+=String.fromCharCode(d),o+=3;continue}}if((s&240)===224&&o+6<i){const a=parseInt(n.slice(o+4,o+6),16),d=parseInt(n.slice(o+7,o+9),16);if((a&192)===128&&(d&192)===128){const c=s<<12&61440|a<<6&4032|d&63;c<2048||c>=55296&&c<=57343?r+="���":r+=String.fromCharCode(c),o+=6;continue}}if((s&248)===240&&o+9<i){const a=parseInt(n.slice(o+4,o+6),16),d=parseInt(n.slice(o+7,o+9),16),c=parseInt(n.slice(o+10,o+12),16);if((a&192)===128&&(d&192)===128&&(c&192)===128){let f=s<<18&1835008|a<<12&258048|d<<6&4032|c&63;f<65536||f>1114111?r+="����":(f-=65536,r+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),o+=9;continue}}r+="�"}return r})}wu.defaultChars=";/?:@&=+$,#";wu.componentChars="";const Vo={};function fc(e){let t=Vo[e];if(t)return t;t=Vo[e]=[];for(let u=0;u<128;u++){const n=String.fromCharCode(u);/^[0-9a-z]$/i.test(n)?t.push(n):t.push("%"+("0"+u.toString(16).toUpperCase()).slice(-2))}for(let u=0;u<e.length;u++)t[e.charCodeAt(u)]=e[u];return t}function Wu(e,t,u){typeof t!="string"&&(u=t,t=Wu.defaultChars),typeof u>"u"&&(u=!0);const n=fc(t);let r="";for(let o=0,i=e.length;o<i;o++){const s=e.charCodeAt(o);if(u&&s===37&&o+2<i&&/^[0-9a-f]{2}$/i.test(e.slice(o+1,o+3))){r+=e.slice(o,o+3),o+=2;continue}if(s<128){r+=n[s];continue}if(s>=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1<i){const a=e.charCodeAt(o+1);if(a>=56320&&a<=57343){r+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[o])}return r}Wu.defaultChars=";/?:@&=+$,-_.!~*'()#";Wu.componentChars="-_.!~*'()";function xo(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function vn(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const pc=/^([a-z0-9.+-]+:)/i,hc=/:[0-9]*$/,mc=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,gc=["<",">",'"',"`"," ","\r",`
220
+ `," "],bc=["{","}","|","\\","^","`"].concat(gc),xc=["'"].concat(bc),Ho=["%","/","?",";","#"].concat(xc),Wo=["/","?","#"],vc=255,Ko=/^[+a-z0-9A-Z_-]{0,63}$/,yc=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,Go={javascript:!0,"javascript:":!0},Zo={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function vo(e,t){if(e&&e instanceof vn)return e;const u=new vn;return u.parse(e,t),u}vn.prototype.parse=function(e,t){let u,n,r,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const d=mc.exec(o);if(d)return this.pathname=d[1],d[2]&&(this.search=d[2]),this}let i=pc.exec(o);if(i&&(i=i[0],u=i.toLowerCase(),this.protocol=i,o=o.substr(i.length)),(t||i||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=o.substr(0,2)==="//",r&&!(i&&Go[i])&&(o=o.substr(2),this.slashes=!0)),!Go[i]&&(r||i&&!Zo[i])){let d=-1;for(let g=0;g<Wo.length;g++)n=o.indexOf(Wo[g]),n!==-1&&(d===-1||n<d)&&(d=n);let c,f;d===-1?f=o.lastIndexOf("@"):f=o.lastIndexOf("@",d),f!==-1&&(c=o.slice(0,f),o=o.slice(f+1),this.auth=c),d=-1;for(let g=0;g<Ho.length;g++)n=o.indexOf(Ho[g]),n!==-1&&(d===-1||n<d)&&(d=n);d===-1&&(d=o.length),o[d-1]===":"&&d--;const m=o.slice(0,d);o=o.slice(d),this.parseHost(m),this.hostname=this.hostname||"";const _=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!_){const g=this.hostname.split(/\./);for(let F=0,B=g.length;F<B;F++){const v=g[F];if(v&&!v.match(Ko)){let x="";for(let D=0,L=v.length;D<L;D++)v.charCodeAt(D)>127?x+="x":x+=v[D];if(!x.match(Ko)){const D=g.slice(0,F),L=g.slice(F+1),$=v.match(yc);$&&(D.push($[1]),L.unshift($[2])),L.length&&(o=L.join(".")+o),this.hostname=D.join(".");break}}}}this.hostname.length>vc&&(this.hostname=""),_&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=o.indexOf("#");s!==-1&&(this.hash=o.substr(s),o=o.slice(0,s));const a=o.indexOf("?");return a!==-1&&(this.search=o.substr(a),o=o.slice(0,a)),o&&(this.pathname=o),Zo[u]&&this.hostname&&!this.pathname&&(this.pathname=""),this};vn.prototype.parseHost=function(e){let t=hc.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const kc=Object.freeze(Object.defineProperty({__proto__:null,decode:wu,encode:Wu,format:xo,parse:vo},Symbol.toStringTag,{value:"Module"})),Ur=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,jr=/[\0-\x1F\x7F-\x9F]/,_c=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,yo=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,Vr=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,Hr=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,Sc=Object.freeze(Object.defineProperty({__proto__:null,Any:Ur,Cc:jr,Cf:_c,P:yo,S:Vr,Z:Hr},Symbol.toStringTag,{value:"Module"})),wc=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(e=>e.charCodeAt(0))),Tc=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(e=>e.charCodeAt(0)));var zn;const Cc=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Ec=(zn=String.fromCodePoint)!==null&&zn!==void 0?zn:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function Ac(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=Cc.get(e))!==null&&t!==void 0?t:e}var rt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(rt||(rt={}));const Dc=32;var Jt;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Jt||(Jt={}));function ro(e){return e>=rt.ZERO&&e<=rt.NINE}function Ic(e){return e>=rt.UPPER_A&&e<=rt.UPPER_F||e>=rt.LOWER_A&&e<=rt.LOWER_F}function Fc(e){return e>=rt.UPPER_A&&e<=rt.UPPER_Z||e>=rt.LOWER_A&&e<=rt.LOWER_Z||ro(e)}function $c(e){return e===rt.EQUALS||Fc(e)}var ot;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ot||(ot={}));var Yt;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Yt||(Yt={}));class Mc{constructor(t,u,n){this.decodeTree=t,this.emitCodePoint=u,this.errors=n,this.state=ot.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Yt.Strict}startEntity(t){this.decodeMode=t,this.state=ot.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,u){switch(this.state){case ot.EntityStart:return t.charCodeAt(u)===rt.NUM?(this.state=ot.NumericStart,this.consumed+=1,this.stateNumericStart(t,u+1)):(this.state=ot.NamedEntity,this.stateNamedEntity(t,u));case ot.NumericStart:return this.stateNumericStart(t,u);case ot.NumericDecimal:return this.stateNumericDecimal(t,u);case ot.NumericHex:return this.stateNumericHex(t,u);case ot.NamedEntity:return this.stateNamedEntity(t,u)}}stateNumericStart(t,u){return u>=t.length?-1:(t.charCodeAt(u)|Dc)===rt.LOWER_X?(this.state=ot.NumericHex,this.consumed+=1,this.stateNumericHex(t,u+1)):(this.state=ot.NumericDecimal,this.stateNumericDecimal(t,u))}addToNumericResult(t,u,n,r){if(u!==n){const o=n-u;this.result=this.result*Math.pow(r,o)+parseInt(t.substr(u,o),r),this.consumed+=o}}stateNumericHex(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(ro(r)||Ic(r))u+=1;else return this.addToNumericResult(t,n,u,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,n,u,16),-1}stateNumericDecimal(t,u){const n=u;for(;u<t.length;){const r=t.charCodeAt(u);if(ro(r))u+=1;else return this.addToNumericResult(t,n,u,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,n,u,10),-1}emitNumericEntity(t,u){var n;if(this.consumed<=u)return(n=this.errors)===null||n===void 0||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===rt.SEMI)this.consumed+=1;else if(this.decodeMode===Yt.Strict)return 0;return this.emitCodePoint(Ac(this.result),this.consumed),this.errors&&(t!==rt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,u){const{decodeTree:n}=this;let r=n[this.treeIndex],o=(r&Jt.VALUE_LENGTH)>>14;for(;u<t.length;u++,this.excess++){const i=t.charCodeAt(u);if(this.treeIndex=Pc(n,r,this.treeIndex+Math.max(1,o),i),this.treeIndex<0)return this.result===0||this.decodeMode===Yt.Attribute&&(o===0||$c(i))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],o=(r&Jt.VALUE_LENGTH)>>14,o!==0){if(i===rt.SEMI)return this.emitNamedEntityData(this.treeIndex,o,this.consumed+this.excess);this.decodeMode!==Yt.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;const{result:u,decodeTree:n}=this,r=(n[u]&Jt.VALUE_LENGTH)>>14;return this.emitNamedEntityData(u,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,u,n){const{decodeTree:r}=this;return this.emitCodePoint(u===1?r[t]&~Jt.VALUE_LENGTH:r[t+1],n),u===3&&this.emitCodePoint(r[t+2],n),n}end(){var t;switch(this.state){case ot.NamedEntity:return this.result!==0&&(this.decodeMode!==Yt.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ot.NumericDecimal:return this.emitNumericEntity(0,2);case ot.NumericHex:return this.emitNumericEntity(0,3);case ot.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ot.EntityStart:return 0}}}function Wr(e){let t="";const u=new Mc(e,n=>t+=Ec(n));return function(r,o){let i=0,s=0;for(;(s=r.indexOf("&",s))>=0;){t+=r.slice(i,s),u.startEntity(o);const d=u.write(r,s+1);if(d<0){i=s+u.end();break}i=s+d,s=d===0?i+1:i}const a=t+r.slice(i);return t="",a}}function Pc(e,t,u,n){const r=(t&Jt.BRANCH_LENGTH)>>7,o=t&Jt.JUMP_TABLE;if(r===0)return o!==0&&n===o?u:-1;if(o){const a=n-o;return a<0||a>=r?-1:e[u+a]-1}let i=u,s=i+r-1;for(;i<=s;){const a=i+s>>>1,d=e[a];if(d<n)i=a+1;else if(d>n)s=a-1;else return e[a+r]}return-1}const Bc=Wr(wc);Wr(Tc);function Kr(e,t=Yt.Legacy){return Bc(e,t)}function Rc(e){return Object.prototype.toString.call(e)}function ko(e){return Rc(e)==="[object String]"}const Lc=Object.prototype.hasOwnProperty;function Nc(e,t){return Lc.call(e,t)}function En(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){if(u){if(typeof u!="object")throw new TypeError(u+"must be object");Object.keys(u).forEach(function(n){e[n]=u[n]})}}),e}function Gr(e,t,u){return[].concat(e.slice(0,t),u,e.slice(t+1))}function _o(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function yn(e){if(e>65535){e-=65536;const t=55296+(e>>10),u=56320+(e&1023);return String.fromCharCode(t,u)}return String.fromCharCode(e)}const Zr=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Oc=/&([a-z#][a-z0-9]{1,31});/gi,zc=new RegExp(Zr.source+"|"+Oc.source,"gi"),qc=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function Uc(e,t){if(t.charCodeAt(0)===35&&qc.test(t)){const n=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return _o(n)?yn(n):e}const u=Kr(e);return u!==e?u:e}function jc(e){return e.indexOf("\\")<0?e:e.replace(Zr,"$1")}function Tu(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(zc,function(t,u,n){return u||Uc(t,n)})}const Vc=/[&<>"]/,Hc=/[&<>"]/g,Wc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"};function Kc(e){return Wc[e]}function eu(e){return Vc.test(e)?e.replace(Hc,Kc):e}const Gc=/[.?*+^$[\]\\(){}|-]/g;function Zc(e){return e.replace(Gc,"\\$&")}function Oe(e){switch(e){case 9:case 32:return!0}return!1}function Uu(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function ju(e){return yo.test(e)||Vr.test(e)}function Vu(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function An(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}const Xc={mdurl:kc,ucmicro:Sc},Yc=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:Gr,assign:En,escapeHtml:eu,escapeRE:Zc,fromCodePoint:yn,has:Nc,isMdAsciiPunct:Vu,isPunctChar:ju,isSpace:Oe,isString:ko,isValidEntityCode:_o,isWhiteSpace:Uu,lib:Xc,normalizeReference:An,unescapeAll:Tu,unescapeMd:jc},Symbol.toStringTag,{value:"Module"}));function Jc(e,t,u){let n,r,o,i;const s=e.posMax,a=e.pos;for(e.pos=t+1,n=1;e.pos<s;){if(o=e.src.charCodeAt(e.pos),o===93&&(n--,n===0)){r=!0;break}if(i=e.pos,e.md.inline.skipToken(e),o===91){if(i===e.pos-1)n++;else if(u)return e.pos=a,-1}}let d=-1;return r&&(d=e.pos),e.pos=a,d}function Qc(e,t,u){let n,r=t;const o={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<u;){if(n=e.charCodeAt(r),n===10||n===60)return o;if(n===62)return o.pos=r+1,o.str=Tu(e.slice(t+1,r)),o.ok=!0,o;if(n===92&&r+1<u){r+=2;continue}r++}return o}let i=0;for(;r<u&&(n=e.charCodeAt(r),!(n===32||n<32||n===127));){if(n===92&&r+1<u){if(e.charCodeAt(r+1)===32)break;r+=2;continue}if(n===40&&(i++,i>32))return o;if(n===41){if(i===0)break;i--}r++}return t===r||i!==0||(o.str=Tu(e.slice(t,r)),o.pos=r,o.ok=!0),o}function e0(e,t,u,n){let r,o=t;const i={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(n)i.str=n.str,i.marker=n.marker;else{if(o>=u)return i;let s=e.charCodeAt(o);if(s!==34&&s!==39&&s!==40)return i;t++,o++,s===40&&(s=41),i.marker=s}for(;o<u;){if(r=e.charCodeAt(o),r===i.marker)return i.pos=o+1,i.str+=Tu(e.slice(t,o)),i.ok=!0,i;if(r===40&&i.marker===41)return i;r===92&&o+1<u&&o++,o++}return i.can_continue=!0,i.str+=Tu(e.slice(t,o)),i}const t0=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:Qc,parseLinkLabel:Jc,parseLinkTitle:e0},Symbol.toStringTag,{value:"Module"})),zt={};zt.code_inline=function(e,t,u,n,r){const o=e[t];return"<code"+r.renderAttrs(o)+">"+eu(o.content)+"</code>"};zt.code_block=function(e,t,u,n,r){const o=e[t];return"<pre"+r.renderAttrs(o)+"><code>"+eu(e[t].content)+`</code></pre>
221
+ `};zt.fence=function(e,t,u,n,r){const o=e[t],i=o.info?Tu(o.info).trim():"";let s="",a="";if(i){const c=i.split(/(\s+)/g);s=c[0],a=c.slice(2).join("")}let d;if(u.highlight?d=u.highlight(o.content,s,a)||eu(o.content):d=eu(o.content),d.indexOf("<pre")===0)return d+`
222
+ `;if(i){const c=o.attrIndex("class"),f=o.attrs?o.attrs.slice():[];c<0?f.push(["class",u.langPrefix+s]):(f[c]=f[c].slice(),f[c][1]+=" "+u.langPrefix+s);const m={attrs:f};return`<pre><code${r.renderAttrs(m)}>${d}</code></pre>
223
+ `}return`<pre><code${r.renderAttrs(o)}>${d}</code></pre>
224
+ `};zt.image=function(e,t,u,n,r){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=r.renderInlineAsText(o.children,u,n),r.renderToken(e,t,u)};zt.hardbreak=function(e,t,u){return u.xhtmlOut?`<br />
225
+ `:`<br>
226
+ `};zt.softbreak=function(e,t,u){return u.breaks?u.xhtmlOut?`<br />
227
+ `:`<br>
228
+ `:`
229
+ `};zt.text=function(e,t){return eu(e[t].content)};zt.html_block=function(e,t){return e[t].content};zt.html_inline=function(e,t){return e[t].content};function Eu(){this.rules=En({},zt)}Eu.prototype.renderAttrs=function(t){let u,n,r;if(!t.attrs)return"";for(r="",u=0,n=t.attrs.length;u<n;u++)r+=" "+eu(t.attrs[u][0])+'="'+eu(t.attrs[u][1])+'"';return r};Eu.prototype.renderToken=function(t,u,n){const r=t[u];let o="";if(r.hidden)return"";r.block&&r.nesting!==-1&&u&&t[u-1].hidden&&(o+=`
230
+ `),o+=(r.nesting===-1?"</":"<")+r.tag,o+=this.renderAttrs(r),r.nesting===0&&n.xhtmlOut&&(o+=" /");let i=!1;if(r.block&&(i=!0,r.nesting===1&&u+1<t.length)){const s=t[u+1];(s.type==="inline"||s.hidden||s.nesting===-1&&s.tag===r.tag)&&(i=!1)}return o+=i?`>
231
+ `:">",o};Eu.prototype.renderInline=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t)}return n};Eu.prototype.renderInlineAsText=function(e,t,u){let n="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":n+=e[r].content;break;case"image":n+=this.renderInlineAsText(e[r].children,t,u);break;case"html_inline":case"html_block":n+=e[r].content;break;case"softbreak":case"hardbreak":n+=`
232
+ `;break}return n};Eu.prototype.render=function(e,t,u){let n="";const r=this.rules;for(let o=0,i=e.length;o<i;o++){const s=e[o].type;s==="inline"?n+=this.renderInline(e[o].children,t,u):typeof r[s]<"u"?n+=r[s](e,o,t,u,this):n+=this.renderToken(e,o,t,u)}return n};function kt(){this.__rules__=[],this.__cache__=null}kt.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};kt.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(u){u.enabled&&u.alt.forEach(function(n){t.indexOf(n)<0&&t.push(n)})}),e.__cache__={},t.forEach(function(u){e.__cache__[u]=[],e.__rules__.forEach(function(n){n.enabled&&(u&&n.alt.indexOf(u)<0||e.__cache__[u].push(n.fn))})})};kt.prototype.at=function(e,t,u){const n=this.__find__(e),r=u||{};if(n===-1)throw new Error("Parser rule not found: "+e);this.__rules__[n].fn=t,this.__rules__[n].alt=r.alt||[],this.__cache__=null};kt.prototype.before=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};kt.prototype.after=function(e,t,u,n){const r=this.__find__(e),o=n||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:u,alt:o.alt||[]}),this.__cache__=null};kt.prototype.push=function(e,t,u){const n=u||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null};kt.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!0,u.push(n)},this),this.__cache__=null,u};kt.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(u){u.enabled=!1}),this.enable(e,t)};kt.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const u=[];return e.forEach(function(n){const r=this.__find__(n);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+n)}this.__rules__[r].enabled=!1,u.push(n)},this),this.__cache__=null,u};kt.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function Bt(e,t,u){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=u,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Bt.prototype.attrIndex=function(t){if(!this.attrs)return-1;const u=this.attrs;for(let n=0,r=u.length;n<r;n++)if(u[n][0]===t)return n;return-1};Bt.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};Bt.prototype.attrSet=function(t,u){const n=this.attrIndex(t),r=[t,u];n<0?this.attrPush(r):this.attrs[n]=r};Bt.prototype.attrGet=function(t){const u=this.attrIndex(t);let n=null;return u>=0&&(n=this.attrs[u][1]),n};Bt.prototype.attrJoin=function(t,u){const n=this.attrIndex(t);n<0?this.attrPush([t,u]):this.attrs[n][1]=this.attrs[n][1]+" "+u};function Xr(e,t,u){this.src=e,this.env=u,this.tokens=[],this.inlineMode=!1,this.md=t}Xr.prototype.Token=Bt;const u0=/\r\n?|\n/g,n0=/\0/g;function o0(e){let t;t=e.src.replace(u0,`
233
+ `),t=t.replace(n0,"�"),e.src=t}function r0(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function i0(e){const t=e.tokens;for(let u=0,n=t.length;u<n;u++){const r=t[u];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function s0(e){return/^<a[>\s]/i.test(e)}function a0(e){return/^<\/a\s*>/i.test(e)}function l0(e){const t=e.tokens;if(e.md.options.linkify)for(let u=0,n=t.length;u<n;u++){if(t[u].type!=="inline"||!e.md.linkify.pretest(t[u].content))continue;let r=t[u].children,o=0;for(let i=r.length-1;i>=0;i--){const s=r[i];if(s.type==="link_close"){for(i--;r[i].level!==s.level&&r[i].type!=="link_open";)i--;continue}if(s.type==="html_inline"&&(s0(s.content)&&o>0&&o--,a0(s.content)&&o++),!(o>0)&&s.type==="text"&&e.md.linkify.test(s.content)){const a=s.content;let d=e.md.linkify.match(a);const c=[];let f=s.level,m=0;d.length>0&&d[0].index===0&&i>0&&r[i-1].type==="text_special"&&(d=d.slice(1));for(let _=0;_<d.length;_++){const g=d[_].url,F=e.md.normalizeLink(g);if(!e.md.validateLink(F))continue;let B=d[_].text;d[_].schema?d[_].schema==="mailto:"&&!/^mailto:/i.test(B)?B=e.md.normalizeLinkText("mailto:"+B).replace(/^mailto:/,""):B=e.md.normalizeLinkText(B):B=e.md.normalizeLinkText("http://"+B).replace(/^http:\/\//,"");const v=d[_].index;if(v>m){const $=new e.Token("text","",0);$.content=a.slice(m,v),$.level=f,c.push($)}const x=new e.Token("link_open","a",1);x.attrs=[["href",F]],x.level=f++,x.markup="linkify",x.info="auto",c.push(x);const D=new e.Token("text","",0);D.content=B,D.level=f,c.push(D);const L=new e.Token("link_close","a",-1);L.level=--f,L.markup="linkify",L.info="auto",c.push(L),m=d[_].lastIndex}if(m<a.length){const _=new e.Token("text","",0);_.content=a.slice(m),_.level=f,c.push(_)}t[u].children=r=Gr(r,i,c)}}}}const Yr=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,c0=/\((c|tm|r)\)/i,d0=/\((c|tm|r)\)/ig,f0={c:"©",r:"®",tm:"™"};function p0(e,t){return f0[t.toLowerCase()]}function h0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&(n.content=n.content.replace(d0,p0)),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function m0(e){let t=0;for(let u=e.length-1;u>=0;u--){const n=e[u];n.type==="text"&&!t&&Yr.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),n.type==="link_open"&&n.info==="auto"&&t--,n.type==="link_close"&&n.info==="auto"&&t++}}function g0(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(c0.test(e.tokens[t].content)&&h0(e.tokens[t].children),Yr.test(e.tokens[t].content)&&m0(e.tokens[t].children))}const b0=/['"]/,Xo=/['"]/g,Yo="’";function nn(e,t,u){return e.slice(0,t)+u+e.slice(t+1)}function x0(e,t){let u;const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=e[r].level;for(u=n.length-1;u>=0&&!(n[u].level<=i);u--);if(n.length=u+1,o.type!=="text")continue;let s=o.content,a=0,d=s.length;e:for(;a<d;){Xo.lastIndex=a;const c=Xo.exec(s);if(!c)break;let f=!0,m=!0;a=c.index+1;const _=c[0]==="'";let g=32;if(c.index-1>=0)g=s.charCodeAt(c.index-1);else for(u=r-1;u>=0&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u--)if(e[u].content){g=e[u].content.charCodeAt(e[u].content.length-1);break}let F=32;if(a<d)F=s.charCodeAt(a);else for(u=r+1;u<e.length&&!(e[u].type==="softbreak"||e[u].type==="hardbreak");u++)if(e[u].content){F=e[u].content.charCodeAt(0);break}const B=Vu(g)||ju(String.fromCharCode(g)),v=Vu(F)||ju(String.fromCharCode(F)),x=Uu(g),D=Uu(F);if(D?f=!1:v&&(x||B||(f=!1)),x?m=!1:B&&(D||v||(m=!1)),F===34&&c[0]==='"'&&g>=48&&g<=57&&(m=f=!1),f&&m&&(f=B,m=v),!f&&!m){_&&(o.content=nn(o.content,c.index,Yo));continue}if(m)for(u=n.length-1;u>=0;u--){let L=n[u];if(n[u].level<i)break;if(L.single===_&&n[u].level===i){L=n[u];let $,te;_?($=t.md.options.quotes[2],te=t.md.options.quotes[3]):($=t.md.options.quotes[0],te=t.md.options.quotes[1]),o.content=nn(o.content,c.index,te),e[L.token].content=nn(e[L.token].content,L.pos,$),a+=te.length-1,L.token===r&&(a+=$.length-1),s=o.content,d=s.length,n.length=u;continue e}}f?n.push({token:r,pos:c.index,single:_,level:i}):m&&_&&(o.content=nn(o.content,c.index,Yo))}}}function v0(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!b0.test(e.tokens[t].content)||x0(e.tokens[t].children,e)}function y0(e){let t,u;const n=e.tokens,r=n.length;for(let o=0;o<r;o++){if(n[o].type!=="inline")continue;const i=n[o].children,s=i.length;for(t=0;t<s;t++)i[t].type==="text_special"&&(i[t].type="text");for(t=u=0;t<s;t++)i[t].type==="text"&&t+1<s&&i[t+1].type==="text"?i[t+1].content=i[t].content+i[t+1].content:(t!==u&&(i[u]=i[t]),u++);t!==u&&(i.length=u)}}const qn=[["normalize",o0],["block",r0],["inline",i0],["linkify",l0],["replacements",g0],["smartquotes",v0],["text_join",y0]];function So(){this.ruler=new kt;for(let e=0;e<qn.length;e++)this.ruler.push(qn[e][0],qn[e][1])}So.prototype.process=function(e){const t=this.ruler.getRules("");for(let u=0,n=t.length;u<n;u++)t[u](e)};So.prototype.State=Xr;function qt(e,t,u,n){this.src=e,this.md=t,this.env=u,this.tokens=n,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,i=0,s=0,a=0,d=r.length,c=!1;i<d;i++){const f=r.charCodeAt(i);if(!c)if(Oe(f)){s++,f===9?a+=4-a%4:a++;continue}else c=!0;(f===10||i===d-1)&&(f!==10&&i++,this.bMarks.push(o),this.eMarks.push(i),this.tShift.push(s),this.sCount.push(a),this.bsCount.push(0),c=!1,s=0,a=0,o=i+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}qt.prototype.push=function(e,t,u){const n=new Bt(e,t,u);return n.block=!0,u<0&&this.level--,n.level=this.level,u>0&&this.level++,this.tokens.push(n),n};qt.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};qt.prototype.skipEmptyLines=function(t){for(let u=this.lineMax;t<u&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};qt.prototype.skipSpaces=function(t){for(let u=this.src.length;t<u;t++){const n=this.src.charCodeAt(t);if(!Oe(n))break}return t};qt.prototype.skipSpacesBack=function(t,u){if(t<=u)return t;for(;t>u;)if(!Oe(this.src.charCodeAt(--t)))return t+1;return t};qt.prototype.skipChars=function(t,u){for(let n=this.src.length;t<n&&this.src.charCodeAt(t)===u;t++);return t};qt.prototype.skipCharsBack=function(t,u,n){if(t<=n)return t;for(;t>n;)if(u!==this.src.charCodeAt(--t))return t+1;return t};qt.prototype.getLines=function(t,u,n,r){if(t>=u)return"";const o=new Array(u-t);for(let i=0,s=t;s<u;s++,i++){let a=0;const d=this.bMarks[s];let c=d,f;for(s+1<u||r?f=this.eMarks[s]+1:f=this.eMarks[s];c<f&&a<n;){const m=this.src.charCodeAt(c);if(Oe(m))m===9?a+=4-(a+this.bsCount[s])%4:a++;else if(c-d<this.tShift[s])a++;else break;c++}a>n?o[i]=new Array(a-n+1).join(" ")+this.src.slice(c,f):o[i]=this.src.slice(c,f)}return o.join("")};qt.prototype.Token=Bt;const k0=65536;function Un(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];return e.src.slice(u,n)}function Jo(e){const t=[],u=e.length;let n=0,r=e.charCodeAt(n),o=!1,i=0,s="";for(;n<u;)r===124&&(o?(s+=e.substring(i,n-1),i=n):(t.push(s+e.substring(i,n)),s="",i=n+1)),o=r===92,n++,r=e.charCodeAt(n);return t.push(s+e.substring(i)),t}function _0(e,t,u,n){if(t+2>u)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const i=e.src.charCodeAt(o++);if(i!==124&&i!==45&&i!==58||o>=e.eMarks[r])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58&&!Oe(s)||i===45&&Oe(s))return!1;for(;o<e.eMarks[r];){const L=e.src.charCodeAt(o);if(L!==124&&L!==45&&L!==58&&!Oe(L))return!1;o++}let a=Un(e,t+1),d=a.split("|");const c=[];for(let L=0;L<d.length;L++){const $=d[L].trim();if(!$){if(L===0||L===d.length-1)continue;return!1}if(!/^:?-+:?$/.test($))return!1;$.charCodeAt($.length-1)===58?c.push($.charCodeAt(0)===58?"center":"right"):$.charCodeAt(0)===58?c.push("left"):c.push("")}if(a=Un(e,t).trim(),a.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;d=Jo(a),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop();const f=d.length;if(f===0||f!==c.length)return!1;if(n)return!0;const m=e.parentType;e.parentType="table";const _=e.md.block.ruler.getRules("blockquote"),g=e.push("table_open","table",1),F=[t,0];g.map=F;const B=e.push("thead_open","thead",1);B.map=[t,t+1];const v=e.push("tr_open","tr",1);v.map=[t,t+1];for(let L=0;L<d.length;L++){const $=e.push("th_open","th",1);c[L]&&($.attrs=[["style","text-align:"+c[L]]]);const te=e.push("inline","",0);te.content=d[L].trim(),te.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let x,D=0;for(r=t+2;r<u&&!(e.sCount[r]<e.blkIndent);r++){let L=!1;for(let te=0,C=_.length;te<C;te++)if(_[te](e,r,u,!0)){L=!0;break}if(L||(a=Un(e,r).trim(),!a)||e.sCount[r]-e.blkIndent>=4||(d=Jo(a),d.length&&d[0]===""&&d.shift(),d.length&&d[d.length-1]===""&&d.pop(),D+=f-d.length,D>k0))break;if(r===t+2){const te=e.push("tbody_open","tbody",1);te.map=x=[t+2,0]}const $=e.push("tr_open","tr",1);$.map=[r,r+1];for(let te=0;te<f;te++){const C=e.push("td_open","td",1);c[te]&&(C.attrs=[["style","text-align:"+c[te]]]);const Q=e.push("inline","",0);Q.content=d[te]?d[te].trim():"",Q.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return x&&(e.push("tbody_close","tbody",-1),x[1]=r),e.push("table_close","table",-1),F[1]=r,e.parentType=m,e.line=r,!0}function S0(e,t,u){if(e.sCount[t]-e.blkIndent<4)return!1;let n=t+1,r=n;for(;n<u;){if(e.isEmpty(n)){n++;continue}if(e.sCount[n]-e.blkIndent>=4){n++,r=n;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+`
234
+ `,o.map=[t,e.line],!0}function w0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const i=e.src.charCodeAt(r);if(i!==126&&i!==96)return!1;let s=r;r=e.skipChars(r,i);let a=r-s;if(a<3)return!1;const d=e.src.slice(s,r),c=e.src.slice(r,o);if(i===96&&c.indexOf(String.fromCharCode(i))>=0)return!1;if(n)return!0;let f=t,m=!1;for(;f++,!(f>=u||(r=s=e.bMarks[f]+e.tShift[f],o=e.eMarks[f],r<o&&e.sCount[f]<e.blkIndent));)if(e.src.charCodeAt(r)===i&&!(e.sCount[f]-e.blkIndent>=4)&&(r=e.skipChars(r,i),!(r-s<a)&&(r=e.skipSpaces(r),!(r<o)))){m=!0;break}a=e.sCount[t],e.line=f+(m?1:0);const _=e.push("fence","code",0);return _.info=c,_.content=e.getLines(t+1,f,a,!0),_.markup=d,_.map=[t,e.line],!0}function T0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const i=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(n)return!0;const s=[],a=[],d=[],c=[],f=e.md.block.ruler.getRules("blockquote"),m=e.parentType;e.parentType="blockquote";let _=!1,g;for(g=t;g<u;g++){const D=e.sCount[g]<e.blkIndent;if(r=e.bMarks[g]+e.tShift[g],o=e.eMarks[g],r>=o)break;if(e.src.charCodeAt(r++)===62&&!D){let $=e.sCount[g]+1,te,C;e.src.charCodeAt(r)===32?(r++,$++,C=!1,te=!0):e.src.charCodeAt(r)===9?(te=!0,(e.bsCount[g]+$)%4===3?(r++,$++,C=!1):C=!0):te=!1;let Q=$;for(s.push(e.bMarks[g]),e.bMarks[g]=r;r<o;){const Y=e.src.charCodeAt(r);if(Oe(Y))Y===9?Q+=4-(Q+e.bsCount[g]+(C?1:0))%4:Q++;else break;r++}_=r>=o,a.push(e.bsCount[g]),e.bsCount[g]=e.sCount[g]+1+(te?1:0),d.push(e.sCount[g]),e.sCount[g]=Q-$,c.push(e.tShift[g]),e.tShift[g]=r-e.bMarks[g];continue}if(_)break;let L=!1;for(let $=0,te=f.length;$<te;$++)if(f[$](e,g,u,!0)){L=!0;break}if(L){e.lineMax=g,e.blkIndent!==0&&(s.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),d.push(e.sCount[g]),e.sCount[g]-=e.blkIndent);break}s.push(e.bMarks[g]),a.push(e.bsCount[g]),c.push(e.tShift[g]),d.push(e.sCount[g]),e.sCount[g]=-1}const F=e.blkIndent;e.blkIndent=0;const B=e.push("blockquote_open","blockquote",1);B.markup=">";const v=[t,0];B.map=v,e.md.block.tokenize(e,t,g);const x=e.push("blockquote_close","blockquote",-1);x.markup=">",e.lineMax=i,e.parentType=m,v[1]=e.line;for(let D=0;D<c.length;D++)e.bMarks[D+t]=s[D],e.tShift[D+t]=c[D],e.sCount[D+t]=d[D],e.bsCount[D+t]=a[D];return e.blkIndent=F,!0}function C0(e,t,u,n){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const i=e.src.charCodeAt(o++);if(i!==42&&i!==45&&i!==95)return!1;let s=1;for(;o<r;){const d=e.src.charCodeAt(o++);if(d!==i&&!Oe(d))return!1;d===i&&s++}if(s<3)return!1;if(n)return!0;e.line=t+1;const a=e.push("hr","hr",0);return a.map=[t,e.line],a.markup=Array(s+1).join(String.fromCharCode(i)),!0}function Qo(e,t){const u=e.eMarks[t];let n=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(n++);if(r!==42&&r!==45&&r!==43)return-1;if(n<u){const o=e.src.charCodeAt(n);if(!Oe(o))return-1}return n}function er(e,t){const u=e.bMarks[t]+e.tShift[t],n=e.eMarks[t];let r=u;if(r+1>=n)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=n)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-u>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<n&&(o=e.src.charCodeAt(r),!Oe(o))?-1:r}function E0(e,t){const u=e.level+2;for(let n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===u&&e.tokens[n].type==="paragraph_open"&&(e.tokens[n+2].hidden=!0,e.tokens[n].hidden=!0,n+=2)}function A0(e,t,u,n){let r,o,i,s,a=t,d=!0;if(e.sCount[a]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[a]-e.listIndent>=4&&e.sCount[a]<e.blkIndent)return!1;let c=!1;n&&e.parentType==="paragraph"&&e.sCount[a]>=e.blkIndent&&(c=!0);let f,m,_;if((_=er(e,a))>=0){if(f=!0,i=e.bMarks[a]+e.tShift[a],m=Number(e.src.slice(i,_-1)),c&&m!==1)return!1}else if((_=Qo(e,a))>=0)f=!1;else return!1;if(c&&e.skipSpaces(_)>=e.eMarks[a])return!1;if(n)return!0;const g=e.src.charCodeAt(_-1),F=e.tokens.length;f?(s=e.push("ordered_list_open","ol",1),m!==1&&(s.attrs=[["start",m]])):s=e.push("bullet_list_open","ul",1);const B=[a,0];s.map=B,s.markup=String.fromCharCode(g);let v=!1;const x=e.md.block.ruler.getRules("list"),D=e.parentType;for(e.parentType="list";a<u;){o=_,r=e.eMarks[a];const L=e.sCount[a]+_-(e.bMarks[a]+e.tShift[a]);let $=L;for(;o<r;){const ce=e.src.charCodeAt(o);if(ce===9)$+=4-($+e.bsCount[a])%4;else if(ce===32)$++;else break;o++}const te=o;let C;te>=r?C=1:C=$-L,C>4&&(C=1);const Q=L+C;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(g);const Y=[a,0];s.map=Y,f&&(s.info=e.src.slice(i,_-1));const N=e.tight,q=e.tShift[a],ue=e.sCount[a],ae=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=Q,e.tight=!0,e.tShift[a]=te-e.bMarks[a],e.sCount[a]=$,te>=r&&e.isEmpty(a+1)?e.line=Math.min(e.line+2,u):e.md.block.tokenize(e,a,u,!0),(!e.tight||v)&&(d=!1),v=e.line-a>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=ae,e.tShift[a]=q,e.sCount[a]=ue,e.tight=N,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(g),a=e.line,Y[1]=a,a>=u||e.sCount[a]<e.blkIndent||e.sCount[a]-e.blkIndent>=4)break;let me=!1;for(let ce=0,ye=x.length;ce<ye;ce++)if(x[ce](e,a,u,!0)){me=!0;break}if(me)break;if(f){if(_=er(e,a),_<0)break;i=e.bMarks[a]+e.tShift[a]}else if(_=Qo(e,a),_<0)break;if(g!==e.src.charCodeAt(_-1))break}return f?s=e.push("ordered_list_close","ol",-1):s=e.push("bullet_list_close","ul",-1),s.markup=String.fromCharCode(g),B[1]=a,e.line=a,e.parentType=D,d&&E0(e,F),!0}function D0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],i=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function s(x){const D=e.lineMax;if(x>=D||e.isEmpty(x))return null;let L=!1;if(e.sCount[x]-e.blkIndent>3&&(L=!0),e.sCount[x]<0&&(L=!0),!L){const C=e.md.block.ruler.getRules("reference"),Q=e.parentType;e.parentType="reference";let Y=!1;for(let N=0,q=C.length;N<q;N++)if(C[N](e,x,D,!0)){Y=!0;break}if(e.parentType=Q,Y)return null}const $=e.bMarks[x]+e.tShift[x],te=e.eMarks[x];return e.src.slice($,te+1)}let a=e.src.slice(r,o+1);o=a.length;let d=-1;for(r=1;r<o;r++){const x=a.charCodeAt(r);if(x===91)return!1;if(x===93){d=r;break}else if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(x===92&&(r++,r<o&&a.charCodeAt(r)===10)){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}}if(d<0||a.charCodeAt(d+1)!==58)return!1;for(r=d+2;r<o;r++){const x=a.charCodeAt(r);if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!Oe(x))break}const c=e.md.helpers.parseLinkDestination(a,r,o);if(!c.ok)return!1;const f=e.md.normalizeLink(c.str);if(!e.md.validateLink(f))return!1;r=c.pos;const m=r,_=i,g=r;for(;r<o;r++){const x=a.charCodeAt(r);if(x===10){const D=s(i);D!==null&&(a+=D,o=a.length,i++)}else if(!Oe(x))break}let F=e.md.helpers.parseLinkTitle(a,r,o);for(;F.can_continue;){const x=s(i);if(x===null)break;a+=x,r=o,o=a.length,i++,F=e.md.helpers.parseLinkTitle(a,r,o,F)}let B;for(r<o&&g!==r&&F.ok?(B=F.str,r=F.pos):(B="",r=m,i=_);r<o;){const x=a.charCodeAt(r);if(!Oe(x))break;r++}if(r<o&&a.charCodeAt(r)!==10&&B)for(B="",r=m,i=_;r<o;){const x=a.charCodeAt(r);if(!Oe(x))break;r++}if(r<o&&a.charCodeAt(r)!==10)return!1;const v=An(a.slice(1,d));return v?(n||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:B,href:f}),e.line=i),!0):!1}const I0=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],F0="[a-zA-Z_:][a-zA-Z0-9:._-]*",$0="[^\"'=<>`\\x00-\\x20]+",M0="'[^']*'",P0='"[^"]*"',B0="(?:"+$0+"|"+M0+"|"+P0+")",R0="(?:\\s+"+F0+"(?:\\s*=\\s*"+B0+")?)",Jr="<[A-Za-z][A-Za-z0-9\\-]*"+R0+"*\\s*\\/?>",Qr="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",L0="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",N0="<[?][\\s\\S]*?[?]>",O0="<![A-Za-z][^>]*>",z0="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",q0=new RegExp("^(?:"+Jr+"|"+Qr+"|"+L0+"|"+N0+"|"+O0+"|"+z0+")"),U0=new RegExp("^(?:"+Jr+"|"+Qr+")"),yu=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+I0.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(U0.source+"\\s*$"),/^$/,!1]];function j0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let i=e.src.slice(r,o),s=0;for(;s<yu.length&&!yu[s][0].test(i);s++);if(s===yu.length)return!1;if(n)return yu[s][2];let a=t+1;if(!yu[s][1].test(i)){for(;a<u&&!(e.sCount[a]<e.blkIndent);a++)if(r=e.bMarks[a]+e.tShift[a],o=e.eMarks[a],i=e.src.slice(r,o),yu[s][1].test(i)){i.length!==0&&a++;break}}e.line=a;const d=e.push("html_block","",0);return d.map=[t,a],d.content=e.getLines(t,a,e.blkIndent,!0),!0}function V0(e,t,u,n){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.src.charCodeAt(r);if(i!==35||r>=o)return!1;let s=1;for(i=e.src.charCodeAt(++r);i===35&&r<o&&s<=6;)s++,i=e.src.charCodeAt(++r);if(s>6||r<o&&!Oe(i))return!1;if(n)return!0;o=e.skipSpacesBack(o,r);const a=e.skipCharsBack(o,35,r);a>r&&Oe(e.src.charCodeAt(a-1))&&(o=a),e.line=t+1;const d=e.push("heading_open","h"+String(s),1);d.markup="########".slice(0,s),d.map=[t,e.line];const c=e.push("inline","",0);c.content=e.src.slice(r,o).trim(),c.map=[t,e.line],c.children=[];const f=e.push("heading_close","h"+String(s),-1);return f.markup="########".slice(0,s),!0}function H0(e,t,u){const n=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,i,s=t+1;for(;s<u&&!e.isEmpty(s);s++){if(e.sCount[s]-e.blkIndent>3)continue;if(e.sCount[s]>=e.blkIndent){let _=e.bMarks[s]+e.tShift[s];const g=e.eMarks[s];if(_<g&&(i=e.src.charCodeAt(_),(i===45||i===61)&&(_=e.skipChars(_,i),_=e.skipSpaces(_),_>=g))){o=i===61?1:2;break}}if(e.sCount[s]<0)continue;let m=!1;for(let _=0,g=n.length;_<g;_++)if(n[_](e,s,u,!0)){m=!0;break}if(m)break}if(!o)return!1;const a=e.getLines(t,s,e.blkIndent,!1).trim();e.line=s+1;const d=e.push("heading_open","h"+String(o),1);d.markup=String.fromCharCode(i),d.map=[t,e.line];const c=e.push("inline","",0);c.content=a,c.map=[t,e.line-1],c.children=[];const f=e.push("heading_close","h"+String(o),-1);return f.markup=String.fromCharCode(i),e.parentType=r,!0}function W0(e,t,u){const n=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<u&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let d=!1;for(let c=0,f=n.length;c<f;c++)if(n[c](e,o,u,!0)){d=!0;break}if(d)break}const i=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const s=e.push("paragraph_open","p",1);s.map=[t,e.line];const a=e.push("inline","",0);return a.content=i,a.map=[t,e.line],a.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const on=[["table",_0,["paragraph","reference"]],["code",S0],["fence",w0,["paragraph","reference","blockquote","list"]],["blockquote",T0,["paragraph","reference","blockquote","list"]],["hr",C0,["paragraph","reference","blockquote","list"]],["list",A0,["paragraph","reference","blockquote"]],["reference",D0],["html_block",j0,["paragraph","reference","blockquote"]],["heading",V0,["paragraph","reference","blockquote"]],["lheading",H0],["paragraph",W0]];function Dn(){this.ruler=new kt;for(let e=0;e<on.length;e++)this.ruler.push(on[e][0],on[e][1],{alt:(on[e][2]||[]).slice()})}Dn.prototype.tokenize=function(e,t,u){const n=this.ruler.getRules(""),r=n.length,o=e.md.options.maxNesting;let i=t,s=!1;for(;i<u&&(e.line=i=e.skipEmptyLines(i),!(i>=u||e.sCount[i]<e.blkIndent));){if(e.level>=o){e.line=u;break}const a=e.line;let d=!1;for(let c=0;c<r;c++)if(d=n[c](e,i,u,!1),d){if(a>=e.line)throw new Error("block rule didn't increment state.line");break}if(!d)throw new Error("none of the block rules matched");e.tight=!s,e.isEmpty(e.line-1)&&(s=!0),i=e.line,i<u&&e.isEmpty(i)&&(s=!0,i++,e.line=i)}};Dn.prototype.parse=function(e,t,u,n){if(!e)return;const r=new this.State(e,t,u,n);this.tokenize(r,r.line,r.lineMax)};Dn.prototype.State=qt;function Ku(e,t,u,n){this.src=e,this.env=u,this.md=t,this.tokens=n,this.tokens_meta=Array(n.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Ku.prototype.pushPending=function(){const e=new Bt("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};Ku.prototype.push=function(e,t,u){this.pending&&this.pushPending();const n=new Bt(e,t,u);let r=null;return u<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),n.level=this.level,u>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(r),n};Ku.prototype.scanDelims=function(e,t){const u=this.posMax,n=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<u&&this.src.charCodeAt(o)===n;)o++;const i=o-e,s=o<u?this.src.charCodeAt(o):32,a=Vu(r)||ju(String.fromCharCode(r)),d=Vu(s)||ju(String.fromCharCode(s)),c=Uu(r),f=Uu(s),m=!f&&(!d||c||a),_=!c&&(!a||f||d);return{can_open:m&&(t||!_||a),can_close:_&&(t||!m||d),length:i}};Ku.prototype.Token=Bt;function K0(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function G0(e,t){let u=e.pos;for(;u<e.posMax&&!K0(e.src.charCodeAt(u));)u++;return u===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,u)),e.pos=u,!0)}const Z0=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function X0(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const u=e.pos,n=e.posMax;if(u+3>n||e.src.charCodeAt(u)!==58||e.src.charCodeAt(u+1)!==47||e.src.charCodeAt(u+2)!==47)return!1;const r=e.pending.match(Z0);if(!r)return!1;const o=r[1],i=e.md.linkify.matchAtStart(e.src.slice(u-o.length));if(!i)return!1;let s=i.url;if(s.length<=o.length)return!1;let a=s.length;for(;a>0&&s.charCodeAt(a-1)===42;)a--;a!==s.length&&(s=s.slice(0,a));const d=e.md.normalizeLink(s);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const c=e.push("link_open","a",1);c.attrs=[["href",d]],c.markup="linkify",c.info="auto";const f=e.push("text","",0);f.content=e.md.normalizeLinkText(s);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=s.length-o.length,!0}function Y0(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==10)return!1;const n=e.pending.length-1,r=e.posMax;if(!t)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){let o=n-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(u++;u<r&&Oe(e.src.charCodeAt(u));)u++;return e.pos=u,!0}const wo=[];for(let e=0;e<256;e++)wo.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){wo[e.charCodeAt(0)]=1});function J0(e,t){let u=e.pos;const n=e.posMax;if(e.src.charCodeAt(u)!==92||(u++,u>=n))return!1;let r=e.src.charCodeAt(u);if(r===10){for(t||e.push("hardbreak","br",0),u++;u<n&&(r=e.src.charCodeAt(u),!!Oe(r));)u++;return e.pos=u,!0}let o=e.src[u];if(r>=55296&&r<=56319&&u+1<n){const s=e.src.charCodeAt(u+1);s>=56320&&s<=57343&&(o+=e.src[u+1],u++)}const i="\\"+o;if(!t){const s=e.push("text_special","",0);r<256&&wo[r]!==0?s.content=o:s.content=i,s.markup=i,s.info="escape"}return e.pos=u+1,!0}function Q0(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==96)return!1;const r=u;u++;const o=e.posMax;for(;u<o&&e.src.charCodeAt(u)===96;)u++;const i=e.src.slice(r,u),s=i.length;if(e.backticksScanned&&(e.backticks[s]||0)<=r)return t||(e.pending+=i),e.pos+=s,!0;let a=u,d;for(;(d=e.src.indexOf("`",a))!==-1;){for(a=d+1;a<o&&e.src.charCodeAt(a)===96;)a++;const c=a-d;if(c===s){if(!t){const f=e.push("code_inline","code",0);f.markup=i,f.content=e.src.slice(u,d).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=a,!0}e.backticks[c]=d}return e.backticksScanned=!0,t||(e.pending+=i),e.pos+=s,!0}function ed(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const i=String.fromCharCode(n);if(o<2)return!1;let s;o%2&&(s=e.push("text","",0),s.content=i,o--);for(let a=0;a<o;a+=2)s=e.push("text","",0),s.content=i+i,e.delimiters.push({marker:n,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function tr(e,t){let u;const n=[],r=t.length;for(let o=0;o<r;o++){const i=t[o];if(i.marker!==126||i.end===-1)continue;const s=t[i.end];u=e.tokens[i.token],u.type="s_open",u.tag="s",u.nesting=1,u.markup="~~",u.content="",u=e.tokens[s.token],u.type="s_close",u.tag="s",u.nesting=-1,u.markup="~~",u.content="",e.tokens[s.token-1].type==="text"&&e.tokens[s.token-1].content==="~"&&n.push(s.token-1)}for(;n.length;){const o=n.pop();let i=o+1;for(;i<e.tokens.length&&e.tokens[i].type==="s_close";)i++;i--,o!==i&&(u=e.tokens[i],e.tokens[i]=e.tokens[o],e.tokens[o]=u)}}function td(e){const t=e.tokens_meta,u=e.tokens_meta.length;tr(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&tr(e,t[n].delimiters)}const ei={tokenize:ed,postProcess:td};function ud(e,t){const u=e.pos,n=e.src.charCodeAt(u);if(t||n!==95&&n!==42)return!1;const r=e.scanDelims(e.pos,n===42);for(let o=0;o<r.length;o++){const i=e.push("text","",0);i.content=String.fromCharCode(n),e.delimiters.push({marker:n,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function ur(e,t){const u=t.length;for(let n=u-1;n>=0;n--){const r=t[n];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],i=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===o.token+1,s=String.fromCharCode(r.marker),a=e.tokens[r.token];a.type=i?"strong_open":"em_open",a.tag=i?"strong":"em",a.nesting=1,a.markup=i?s+s:s,a.content="";const d=e.tokens[o.token];d.type=i?"strong_close":"em_close",d.tag=i?"strong":"em",d.nesting=-1,d.markup=i?s+s:s,d.content="",i&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--)}}function nd(e){const t=e.tokens_meta,u=e.tokens_meta.length;ur(e,e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&ur(e,t[n].delimiters)}const ti={tokenize:ud,postProcess:nd};function od(e,t){let u,n,r,o,i="",s="",a=e.pos,d=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const c=e.pos,f=e.posMax,m=e.pos+1,_=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(_<0)return!1;let g=_+1;if(g<f&&e.src.charCodeAt(g)===40){for(d=!1,g++;g<f&&(u=e.src.charCodeAt(g),!(!Oe(u)&&u!==10));g++);if(g>=f)return!1;if(a=g,r=e.md.helpers.parseLinkDestination(e.src,g,e.posMax),r.ok){for(i=e.md.normalizeLink(r.str),e.md.validateLink(i)?g=r.pos:i="",a=g;g<f&&(u=e.src.charCodeAt(g),!(!Oe(u)&&u!==10));g++);if(r=e.md.helpers.parseLinkTitle(e.src,g,e.posMax),g<f&&a!==g&&r.ok)for(s=r.str,g=r.pos;g<f&&(u=e.src.charCodeAt(g),!(!Oe(u)&&u!==10));g++);}(g>=f||e.src.charCodeAt(g)!==41)&&(d=!0),g++}if(d){if(typeof e.env.references>"u")return!1;if(g<f&&e.src.charCodeAt(g)===91?(a=g+1,g=e.md.helpers.parseLinkLabel(e,g),g>=0?n=e.src.slice(a,g++):g=_+1):g=_+1,n||(n=e.src.slice(m,_)),o=e.env.references[An(n)],!o)return e.pos=c,!1;i=o.href,s=o.title}if(!t){e.pos=m,e.posMax=_;const F=e.push("link_open","a",1),B=[["href",i]];F.attrs=B,s&&B.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=g,e.posMax=f,!0}function rd(e,t){let u,n,r,o,i,s,a,d,c="";const f=e.pos,m=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const _=e.pos+2,g=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(g<0)return!1;if(o=g+1,o<m&&e.src.charCodeAt(o)===40){for(o++;o<m&&(u=e.src.charCodeAt(o),!(!Oe(u)&&u!==10));o++);if(o>=m)return!1;for(d=o,s=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),s.ok&&(c=e.md.normalizeLink(s.str),e.md.validateLink(c)?o=s.pos:c=""),d=o;o<m&&(u=e.src.charCodeAt(o),!(!Oe(u)&&u!==10));o++);if(s=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<m&&d!==o&&s.ok)for(a=s.str,o=s.pos;o<m&&(u=e.src.charCodeAt(o),!(!Oe(u)&&u!==10));o++);else a="";if(o>=m||e.src.charCodeAt(o)!==41)return e.pos=f,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<m&&e.src.charCodeAt(o)===91?(d=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(d,o++):o=g+1):o=g+1,r||(r=e.src.slice(_,g)),i=e.env.references[An(r)],!i)return e.pos=f,!1;c=i.href,a=i.title}if(!t){n=e.src.slice(_,g);const F=[];e.md.inline.parse(n,e.md,e.env,F);const B=e.push("image","img",0),v=[["src",c],["alt",""]];B.attrs=v,B.children=F,B.content=n,a&&v.push(["title",a])}return e.pos=o,e.posMax=m,!0}const id=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,sd=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function ad(e,t){let u=e.pos;if(e.src.charCodeAt(u)!==60)return!1;const n=e.pos,r=e.posMax;for(;;){if(++u>=r)return!1;const i=e.src.charCodeAt(u);if(i===60)return!1;if(i===62)break}const o=e.src.slice(n+1,u);if(sd.test(o)){const i=e.md.normalizeLink(o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}if(id.test(o)){const i=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(i))return!1;if(!t){const s=e.push("link_open","a",1);s.attrs=[["href",i]],s.markup="autolink",s.info="auto";const a=e.push("text","",0);a.content=e.md.normalizeLinkText(o);const d=e.push("link_close","a",-1);d.markup="autolink",d.info="auto"}return e.pos+=o.length+2,!0}return!1}function ld(e){return/^<a[>\s]/i.test(e)}function cd(e){return/^<\/a\s*>/i.test(e)}function dd(e){const t=e|32;return t>=97&&t<=122}function fd(e,t){if(!e.md.options.html)return!1;const u=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=u)return!1;const r=e.src.charCodeAt(n+1);if(r!==33&&r!==63&&r!==47&&!dd(r))return!1;const o=e.src.slice(n).match(q0);if(!o)return!1;if(!t){const i=e.push("html_inline","",0);i.content=o[0],ld(i.content)&&e.linkLevel++,cd(i.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const pd=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,hd=/^&([a-z][a-z0-9]{1,31});/i;function md(e,t){const u=e.pos,n=e.posMax;if(e.src.charCodeAt(u)!==38||u+1>=n)return!1;if(e.src.charCodeAt(u+1)===35){const o=e.src.slice(u).match(pd);if(o){if(!t){const i=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),s=e.push("text_special","",0);s.content=_o(i)?yn(i):yn(65533),s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(u).match(hd);if(o){const i=Kr(o[0]);if(i!==o[0]){if(!t){const s=e.push("text_special","",0);s.content=i,s.markup=o[0],s.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function nr(e){const t={},u=e.length;if(!u)return;let n=0,r=-2;const o=[];for(let i=0;i<u;i++){const s=e[i];if(o.push(0),(e[n].marker!==s.marker||r!==s.token-1)&&(n=i),r=s.token,s.length=s.length||0,!s.close)continue;t.hasOwnProperty(s.marker)||(t[s.marker]=[-1,-1,-1,-1,-1,-1]);const a=t[s.marker][(s.open?3:0)+s.length%3];let d=n-o[n]-1,c=d;for(;d>a;d-=o[d]+1){const f=e[d];if(f.marker===s.marker&&f.open&&f.end<0){let m=!1;if((f.close||s.open)&&(f.length+s.length)%3===0&&(f.length%3!==0||s.length%3!==0)&&(m=!0),!m){const _=d>0&&!e[d-1].open?o[d-1]+1:0;o[i]=i-d+_,o[d]=_,s.open=!1,f.end=i,f.close=!1,c=-1,r=-2;break}}}c!==-1&&(t[s.marker][(s.open?3:0)+(s.length||0)%3]=c)}}function gd(e){const t=e.tokens_meta,u=e.tokens_meta.length;nr(e.delimiters);for(let n=0;n<u;n++)t[n]&&t[n].delimiters&&nr(t[n].delimiters)}function bd(e){let t,u,n=0;const r=e.tokens,o=e.tokens.length;for(t=u=0;t<o;t++)r[t].nesting<0&&n--,r[t].level=n,r[t].nesting>0&&n++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==u&&(r[u]=r[t]),u++);t!==u&&(r.length=u)}const jn=[["text",G0],["linkify",X0],["newline",Y0],["escape",J0],["backticks",Q0],["strikethrough",ei.tokenize],["emphasis",ti.tokenize],["link",od],["image",rd],["autolink",ad],["html_inline",fd],["entity",md]],Vn=[["balance_pairs",gd],["strikethrough",ei.postProcess],["emphasis",ti.postProcess],["fragments_join",bd]];function Gu(){this.ruler=new kt;for(let e=0;e<jn.length;e++)this.ruler.push(jn[e][0],jn[e][1]);this.ruler2=new kt;for(let e=0;e<Vn.length;e++)this.ruler2.push(Vn[e][0],Vn[e][1])}Gu.prototype.skipToken=function(e){const t=e.pos,u=this.ruler.getRules(""),n=u.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let i=!1;if(e.level<r){for(let s=0;s<n;s++)if(e.level++,i=u[s](e,!0),e.level--,i){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;i||e.pos++,o[t]=e.pos};Gu.prototype.tokenize=function(e){const t=this.ruler.getRules(""),u=t.length,n=e.posMax,r=e.md.options.maxNesting;for(;e.pos<n;){const o=e.pos;let i=!1;if(e.level<r){for(let s=0;s<u;s++)if(i=t[s](e,!1),i){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(i){if(e.pos>=n)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Gu.prototype.parse=function(e,t,u,n){const r=new this.State(e,t,u,n);this.tokenize(r);const o=this.ruler2.getRules(""),i=o.length;for(let s=0;s<i;s++)o[s](r)};Gu.prototype.State=Ku;function xd(e){const t={};e=e||{},t.src_Any=Ur.source,t.src_Cc=jr.source,t.src_Z=Hr.source,t.src_P=yo.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const u="[><|]";return t.src_pseudo_letter="(?:(?!"+u+"|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+u+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+u+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+u+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function io(e){return Array.prototype.slice.call(arguments,1).forEach(function(u){u&&Object.keys(u).forEach(function(n){e[n]=u[n]})}),e}function In(e){return Object.prototype.toString.call(e)}function vd(e){return In(e)==="[object String]"}function yd(e){return In(e)==="[object Object]"}function kd(e){return In(e)==="[object RegExp]"}function or(e){return In(e)==="[object Function]"}function _d(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const ui={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Sd(e){return Object.keys(e||{}).reduce(function(t,u){return t||ui.hasOwnProperty(u)},!1)}const wd={"http:":{validate:function(e,t,u){const n=e.slice(t);return u.re.http||(u.re.http=new RegExp("^\\/\\/"+u.re.src_auth+u.re.src_host_port_strict+u.re.src_path,"i")),u.re.http.test(n)?n.match(u.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,u){const n=e.slice(t);return u.re.no_http||(u.re.no_http=new RegExp("^"+u.re.src_auth+"(?:localhost|(?:(?:"+u.re.src_domain+")\\.)+"+u.re.src_domain_root+")"+u.re.src_port+u.re.src_host_terminator+u.re.src_path,"i")),u.re.no_http.test(n)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:n.match(u.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,u){const n=e.slice(t);return u.re.mailto||(u.re.mailto=new RegExp("^"+u.re.src_email_name+"@"+u.re.src_host_strict,"i")),u.re.mailto.test(n)?n.match(u.re.mailto)[0].length:0}}},Td="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Cd="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Ed(e){e.__index__=-1,e.__text_cache__=""}function Ad(e){return function(t,u){const n=t.slice(u);return e.test(n)?n.match(e)[0].length:0}}function rr(){return function(e,t){t.normalize(e)}}function kn(e){const t=e.re=xd(e.__opts__),u=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||u.push(Td),u.push(t.src_xn),t.src_tlds=u.join("|");function n(s){return s.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(n(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(n(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(n(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(n(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(s,a){throw new Error('(LinkifyIt) Invalid schema "'+s+'": '+a)}Object.keys(e.__schemas__).forEach(function(s){const a=e.__schemas__[s];if(a===null)return;const d={validate:null,link:null};if(e.__compiled__[s]=d,yd(a)){kd(a.validate)?d.validate=Ad(a.validate):or(a.validate)?d.validate=a.validate:o(s,a),or(a.normalize)?d.normalize=a.normalize:a.normalize?o(s,a):d.normalize=rr();return}if(vd(a)){r.push(s);return}o(s,a)}),r.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:rr()};const i=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(_d).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+i+")","ig"),e.re.schema_at_start=RegExp("^"+e.re.schema_search.source,"i"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),Ed(e)}function Dd(e,t){const u=e.__index__,n=e.__last_index__,r=e.__text_cache__.slice(u,n);this.schema=e.__schema__.toLowerCase(),this.index=u+t,this.lastIndex=n+t,this.raw=r,this.text=r,this.url=r}function so(e,t){const u=new Dd(e,t);return e.__compiled__[u.schema].normalize(u,e),u}function At(e,t){if(!(this instanceof At))return new At(e,t);t||Sd(e)&&(t=e,e={}),this.__opts__=io({},ui,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=io({},wd,e),this.__compiled__={},this.__tlds__=Cd,this.__tlds_replaced__=!1,this.re={},kn(this)}At.prototype.add=function(t,u){return this.__schemas__[t]=u,kn(this),this};At.prototype.set=function(t){return this.__opts__=io(this.__opts__,t),this};At.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let u,n,r,o,i,s,a,d,c;if(this.re.schema_test.test(t)){for(a=this.re.schema_search,a.lastIndex=0;(u=a.exec(t))!==null;)if(o=this.testSchemaAt(t,u[2],a.lastIndex),o){this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(d=t.search(this.re.host_fuzzy_test),d>=0&&(this.__index__<0||d<this.__index__)&&(n=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(i=n.index+n[1].length,(this.__index__<0||i<this.__index__)&&(this.__schema__="",this.__index__=i,this.__last_index__=n.index+n[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=t.indexOf("@"),c>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(i=r.index+r[1].length,s=r.index+r[0].length,(this.__index__<0||i<this.__index__||i===this.__index__&&s>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=s))),this.__index__>=0};At.prototype.pretest=function(t){return this.re.pretest.test(t)};At.prototype.testSchemaAt=function(t,u,n){return this.__compiled__[u.toLowerCase()]?this.__compiled__[u.toLowerCase()].validate(t,n,this):0};At.prototype.match=function(t){const u=[];let n=0;this.__index__>=0&&this.__text_cache__===t&&(u.push(so(this,n)),n=this.__last_index__);let r=n?t.slice(n):t;for(;this.test(r);)u.push(so(this,n)),r=r.slice(this.__last_index__),n+=this.__last_index__;return u.length?u:null};At.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const u=this.re.schema_at_start.exec(t);if(!u)return null;const n=this.testSchemaAt(t,u[2],u[0].length);return n?(this.__schema__=u[2],this.__index__=u.index+u[1].length,this.__last_index__=u.index+u[0].length+n,so(this,0)):null};At.prototype.tlds=function(t,u){return t=Array.isArray(t)?t:[t],u?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(n,r,o){return n!==o[r-1]}).reverse(),kn(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,kn(this),this)};At.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)};At.prototype.onCompile=function(){};const _u=2147483647,Lt=36,To=1,Hu=26,Id=38,Fd=700,ni=72,oi=128,ri="-",$d=/^xn--/,Md=/[^\0-\x7F]/,Pd=/[\x2E\u3002\uFF0E\uFF61]/g,Bd={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Hn=Lt-To,Nt=Math.floor,Wn=String.fromCharCode;function Xt(e){throw new RangeError(Bd[e])}function Rd(e,t){const u=[];let n=e.length;for(;n--;)u[n]=t(e[n]);return u}function ii(e,t){const u=e.split("@");let n="";u.length>1&&(n=u[0]+"@",e=u[1]),e=e.replace(Pd,".");const r=e.split("."),o=Rd(r,t).join(".");return n+o}function si(e){const t=[];let u=0;const n=e.length;for(;u<n;){const r=e.charCodeAt(u++);if(r>=55296&&r<=56319&&u<n){const o=e.charCodeAt(u++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),u--)}else t.push(r)}return t}const Ld=e=>String.fromCodePoint(...e),Nd=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:Lt},ir=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},ai=function(e,t,u){let n=0;for(e=u?Nt(e/Fd):e>>1,e+=Nt(e/t);e>Hn*Hu>>1;n+=Lt)e=Nt(e/Hn);return Nt(n+(Hn+1)*e/(e+Id))},li=function(e){const t=[],u=e.length;let n=0,r=oi,o=ni,i=e.lastIndexOf(ri);i<0&&(i=0);for(let s=0;s<i;++s)e.charCodeAt(s)>=128&&Xt("not-basic"),t.push(e.charCodeAt(s));for(let s=i>0?i+1:0;s<u;){const a=n;for(let c=1,f=Lt;;f+=Lt){s>=u&&Xt("invalid-input");const m=Nd(e.charCodeAt(s++));m>=Lt&&Xt("invalid-input"),m>Nt((_u-n)/c)&&Xt("overflow"),n+=m*c;const _=f<=o?To:f>=o+Hu?Hu:f-o;if(m<_)break;const g=Lt-_;c>Nt(_u/g)&&Xt("overflow"),c*=g}const d=t.length+1;o=ai(n-a,d,a==0),Nt(n/d)>_u-r&&Xt("overflow"),r+=Nt(n/d),n%=d,t.splice(n++,0,r)}return String.fromCodePoint(...t)},ci=function(e){const t=[];e=si(e);const u=e.length;let n=oi,r=0,o=ni;for(const a of e)a<128&&t.push(Wn(a));const i=t.length;let s=i;for(i&&t.push(ri);s<u;){let a=_u;for(const c of e)c>=n&&c<a&&(a=c);const d=s+1;a-n>Nt((_u-r)/d)&&Xt("overflow"),r+=(a-n)*d,n=a;for(const c of e)if(c<n&&++r>_u&&Xt("overflow"),c===n){let f=r;for(let m=Lt;;m+=Lt){const _=m<=o?To:m>=o+Hu?Hu:m-o;if(f<_)break;const g=f-_,F=Lt-_;t.push(Wn(ir(_+g%F,0))),f=Nt(g/F)}t.push(Wn(ir(f,0))),o=ai(r,d,s===i),r=0,++s}++r,++n}return t.join("")},Od=function(e){return ii(e,function(t){return $d.test(t)?li(t.slice(4).toLowerCase()):t})},zd=function(e){return ii(e,function(t){return Md.test(t)?"xn--"+ci(t):t})},di={version:"2.3.1",ucs2:{decode:si,encode:Ld},decode:li,encode:ci,toASCII:zd,toUnicode:Od},qd={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Ud={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},jd={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},Vd={default:qd,zero:Ud,commonmark:jd},Hd=/^(vbscript|javascript|file|data):/,Wd=/^data:image\/(gif|png|jpeg|webp);/;function Kd(e){const t=e.trim().toLowerCase();return Hd.test(t)?Wd.test(t):!0}const fi=["http:","https:","mailto:"];function Gd(e){const t=vo(e,!0);if(t.hostname&&(!t.protocol||fi.indexOf(t.protocol)>=0))try{t.hostname=di.toASCII(t.hostname)}catch{}return Wu(xo(t))}function Zd(e){const t=vo(e,!0);if(t.hostname&&(!t.protocol||fi.indexOf(t.protocol)>=0))try{t.hostname=di.toUnicode(t.hostname)}catch{}return wu(xo(t),wu.defaultChars+"%")}function $t(e,t){if(!(this instanceof $t))return new $t(e,t);t||ko(e)||(t=e||{},e="default"),this.inline=new Gu,this.block=new Dn,this.core=new So,this.renderer=new Eu,this.linkify=new At,this.validateLink=Kd,this.normalizeLink=Gd,this.normalizeLinkText=Zd,this.utils=Yc,this.helpers=En({},t0),this.options={},this.configure(e),t&&this.set(t)}$t.prototype.set=function(e){return En(this.options,e),this};$t.prototype.configure=function(e){const t=this;if(ko(e)){const u=e;if(e=Vd[u],!e)throw new Error('Wrong `markdown-it` preset "'+u+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(u){e.components[u].rules&&t[u].ruler.enableOnly(e.components[u].rules),e.components[u].rules2&&t[u].ruler2.enableOnly(e.components[u].rules2)}),this};$t.prototype.enable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.enable(e,!0))},this),u=u.concat(this.inline.ruler2.enable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+n);return this};$t.prototype.disable=function(e,t){let u=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){u=u.concat(this[r].ruler.disable(e,!0))},this),u=u.concat(this.inline.ruler2.disable(e,!0));const n=e.filter(function(r){return u.indexOf(r)<0});if(n.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+n);return this};$t.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};$t.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const u=new this.core.State(e,this,t);return this.core.process(u),u.tokens};$t.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};$t.prototype.parseInline=function(e,t){const u=new this.core.State(e,this,t);return u.inlineMode=!0,this.core.process(u),u.tokens};$t.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const gu=new $t({html:!1,breaks:!0,linkify:!0,typographer:!1}),sr=gu.renderer.rules.link_open,ar=gu.renderer.rules.table_open,lr=gu.renderer.rules.table_close;gu.renderer.rules.link_open=(e,t,u,n,r)=>{const o=e[t];return o.attrSet("target","_blank"),o.attrSet("rel","noreferrer noopener"),typeof sr=="function"?sr(e,t,u,n,r):r.renderToken(e,t,u)};gu.renderer.rules.table_open=(e,t,u,n,r)=>`<div class="codex-table-wrap">${typeof ar=="function"?ar(e,t,u,n,r):r.renderToken(e,t,u)}`;gu.renderer.rules.table_close=(e,t,u,n,r)=>`${typeof lr=="function"?lr(e,t,u,n,r):r.renderToken(e,t,u)}</div>`;function cr(e=""){const t=String(e||"").trim();return t?gu.render(t):""}const Xd={class:"panel relative flex h-full min-h-0 flex-col overflow-hidden"},Yd={class:"workbench-panel-header theme-divider theme-muted-panel border-b p-3"},Jd={class:"flex flex-col gap-3"},Qd={class:"flex flex-wrap items-center gap-2"},ef={class:"min-w-0 shrink-0"},tf={class:"theme-heading flex items-center gap-2 text-sm font-medium"},uf={key:0,class:"theme-muted-text mt-1 text-xs"},nf={class:"ml-auto flex items-center gap-2"},of=["disabled"],rf=["disabled"],sf={class:"flex flex-col gap-2 sm:flex-row sm:items-center"},af={class:"min-w-0 flex-1"},lf={key:0,class:"theme-danger-text inline-flex items-center gap-2 text-sm"},cf={class:"min-h-0 flex-1"},df={key:0,class:"theme-empty-state px-4 py-6 text-sm"},ff={class:"flex justify-end"},pf={class:"transcript-card transcript-card--prompt min-w-0 w-full max-w-[92%] rounded-sm border border-dashed border-[var(--theme-promptBorder)] bg-[var(--theme-promptBg)] px-4 py-3 text-sm text-[var(--theme-promptText)]"},hf={class:"flex items-center justify-between gap-3 text-xs opacity-75"},mf={class:"flex items-center gap-2"},gf=["onClick"],bf={class:"relative mt-2"},xf={key:0,class:"whitespace-pre-wrap break-all font-sans leading-7"},vf={key:1,class:"transcript-card__media overflow-hidden rounded-sm border border-dashed border-[var(--theme-promptBorder)]/70 bg-white/40"},yf={class:"flex items-center gap-2 border-b border-dashed border-[var(--theme-promptBorder)]/60 px-3 py-2 text-xs opacity-80"},kf={class:"px-3 py-3"},_f=["onClick"],Sf=["src","alt"],wf={key:2,class:"pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t from-[var(--theme-promptBg)] via-[var(--theme-promptBg)] to-transparent"},Tf={class:"flex justify-start"},Cf={class:"flex items-center justify-between gap-3 text-xs"},Ef={class:"flex items-center gap-2"},Af=["disabled","onClick"],Df={key:0,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/10 px-3 py-2 text-xs text-current/70"},If={key:1,class:"mt-3 space-y-3"},Ff={class:"text-sm font-medium leading-6"},$f={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-5 opacity-85"},Mf={key:2,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/10 px-3 py-2 text-xs text-current/70"},Pf={key:3,class:"mt-3 text-xs text-current/80"},Bf={key:4,class:"transcript-card__subtle mt-3 rounded-sm border border-dashed border-current/15 bg-white/15 px-3 py-2 text-xs text-current/80"},Rf={class:"flex items-start justify-between gap-3"},Lf={class:"min-w-0 flex-1"},Nf={key:0,class:"leading-5"},Of={key:1,class:"mt-1 break-all leading-5 opacity-75"},zf={key:2,class:"mt-2 flex flex-wrap gap-2"},qf={class:"opacity-75"},Uf={class:"font-medium"},jf=["onClick"],Vf={key:0,class:"flex justify-start"},Hf={class:"flex items-center justify-between gap-3 text-xs text-current/80"},Wf=["onClick"],Kf={class:"relative mt-2"},Gf=["innerHTML"],Zf={class:"pointer-events-none absolute bottom-1 right-1 z-10 flex flex-col items-end gap-1.5 sm:bottom-3 sm:right-3"},Xf=["disabled"],Yf={key:2,class:"task-loading-dots","aria-hidden":"true"},rn="max-h-40 overflow-hidden",Jf={__name:"CodexSessionPanel",props:{prompt:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},beforeSend:{type:Function,default:null},afterSend:{type:Function,default:null},taskSlug:{type:String,default:""},selectedSessionId:{type:String,default:""},active:{type:Boolean,default:!1},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1}},emits:["project-created","selected-session-change","sending-change","open-diff"],setup(e,{expose:t,emit:u}){const n=Xn(()=>Yn(()=>import("./CodexSessionManagerDialog-ByhnEYj3.js"),__vite__mapDeps([0,1,2,3]))),r=u,o=e,{closeManager:i,formatTurnTime:s,getProcessCardClass:a,getProcessStatus:d,getTurnAgentLabel:c,getDisplayTurnSummaryItems:f,getTurnSummaryDetail:m,getTurnSummaryStatus:_,handleCreateSession:g,handleDeleteSession:F,handleSelectSession:B,handleSend:v,handleTranscriptScroll:x,handleTranscriptTouchEnd:D,handleTranscriptTouchMove:L,handleTranscriptTouchStart:$,handleUpdateSession:te,helperText:C,loadTurnEvents:Q,loading:Y,managerBusy:N,openManager:q,refreshSessionsForSelection:ue,selectedSessionId:ae,sending:me,stopping:ce,hasTurnSummary:ye,hasNewerMessages:j,sessionError:K,shouldShowResponse:T,showManager:X,sortedSessions:de,stopSending:U,transcriptRef:W,turns:J,workspaces:ge,sessions:oe,loadSessions:Ie,scrollToBottom:_e}=rc(o,r),Me=new Map,$e=H(""),{t:fe}=_t(),{canCollapsePrompt:Ze,canCollapseResponse:Ye,getTurnEventCount:Be,hasTurnEventHistory:Le,isPromptCollapsed:it,isResponseCollapsed:Xe,isTurnEventsCollapsed:St,togglePrompt:gt,toggleResponse:et,toggleTurnEvents:st}=cc({turns:J,loadTurnEvents:Q});function lt(Te){return String((Te==null?void 0:Te.runId)||(Te==null?void 0:Te.id)||"").trim()}function bt(Te){Te!=null&&Te.runId&&r("open-diff",{scope:"run",runId:Te.runId})}function xt(){r("open-diff",{scope:"workspace",runId:""})}function Ke(Te){if(Te!=null&&Te.errorMessage)return"";const xe=String((Te==null?void 0:Te.responseMessage)||""),y=lt(Te);if(!y)return cr(xe);const be=Me.get(y);if((be==null?void 0:be.source)===xe)return be.html;const ze=cr(xe);return Me.set(y,{source:xe,html:ze}),ze}function ct(Te){$e.value=String(Te||"").trim()}const qe=le(()=>J.value.flatMap(Te=>(Array.isArray(Te==null?void 0:Te.promptBlocks)?Te.promptBlocks:[]).filter(xe=>(xe==null?void 0:xe.type)==="image").map(xe=>xe.content)));return Ee(J,Te=>{const xe=new Set((Te||[]).map(y=>lt(y)).filter(Boolean));for(const y of Me.keys())xe.has(y)||Me.delete(y)},{immediate:!0,deep:!0}),t({send:v,scrollToBottom:_e,stop:U}),(Te,xe)=>(E(),O("section",Xd,[l(X)?(E(),we(l(n),{key:0,open:l(X),sessions:l(oe),workspaces:l(ge),"selected-session-id":l(ae),"selection-locked":e.sessionSelectionLocked,"selection-lock-reason":e.sessionSelectionLockReason,loading:l(Y),sending:l(me),"on-refresh":l(Ie),"on-create":l(g),"on-update":l(te),"on-delete":l(F),onClose:l(i),onProjectCreated:xe[0]||(xe[0]=y=>r("project-created",y)),onSelectSession:l(B)},null,8,["open","sessions","workspaces","selected-session-id","selection-locked","selection-lock-reason","loading","sending","on-refresh","on-create","on-update","on-delete","onClose","onSelectSession"])):ve("",!0),p("div",Yd,[p("div",Jd,[p("div",Qd,[p("div",ef,[p("div",tf,[ie(l(Ai),{class:"h-4 w-4"}),p("span",null,A(l(fe)("sessionPanel.project")),1)]),l(C)?(E(),O("p",uf,A(l(C)),1)):ve("",!0)]),p("div",nf,[e.diffSupported?(E(),O("button",{key:0,type:"button",class:"tool-button tool-button-info-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:!e.taskSlug,onClick:xt},[ie(l($o),{class:"h-4 w-4"}),p("span",null,A(l(fe)("sessionPanel.diff")),1)],8,of)):ve("",!0),p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:l(N),onClick:xe[1]||(xe[1]=(...y)=>l(q)&&l(q)(...y))},[ie(l(Ou),{class:"h-4 w-4"}),p("span",null,A(l(fe)("sessionPanel.manageProjects")),1)],8,rf)])]),p("div",sf,[p("div",af,[ie(vl,{modelValue:l(ae),"onUpdate:modelValue":xe[2]||(xe[2]=y=>mi(ae)?ae.value=y:null),sessions:l(de),loading:l(Y),disabled:l(me)||l(N)||e.sessionSelectionLocked,onRefreshIntent:l(ue)},null,8,["modelValue","sessions","loading","disabled","onRefreshIntent"])])]),l(K)?(E(),O("p",lf,[ie(l(vr),{class:"h-4 w-4"}),p("span",null,A(l(K)),1)])):ve("",!0)])]),p("div",cf,[p("div",{ref_key:"transcriptRef",ref:W,class:"h-full space-y-4 overflow-y-auto px-4 py-4",onScroll:xe[3]||(xe[3]=(...y)=>l(x)&&l(x)(...y)),onTouchstartPassive:xe[4]||(xe[4]=(...y)=>l($)&&l($)(...y)),onTouchmovePassive:xe[5]||(xe[5]=(...y)=>l(L)&&l(L)(...y)),onTouchendPassive:xe[6]||(xe[6]=(...y)=>l(D)&&l(D)(...y)),onTouchcancelPassive:xe[7]||(xe[7]=(...y)=>l(D)&&l(D)(...y))},[l(J).length?ve("",!0):(E(),O("div",df,A(l(fe)("sessionPanel.empty")),1)),(E(!0),O(mt,null,Ft(l(J),y=>(E(),O("div",{key:y.id,class:"space-y-3"},[p("div",ff,[p("div",pf,[p("div",hf,[p("span",null,A(l(fe)("sessionPanel.promptTitle")),1),p("div",mf,[l(Ze)(y)?(E(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:be=>l(gt)(y)},[l(it)(y)?(E(),we(l(Lu),{key:0,class:"h-3 w-3"})):(E(),we(l(Mn),{key:1,class:"h-3 w-3"})),p("span",null,A(l(it)(y)?l(fe)("sessionPanel.expand"):l(fe)("sessionPanel.collapse")),1)],8,gf)):ve("",!0),p("span",null,A(l(s)(y.startedAt)),1)])]),p("div",bf,[Array.isArray(y.promptBlocks)&&y.promptBlocks.length?(E(),O("div",{key:0,class:Se(["space-y-3",l(Ze)(y)&&l(it)(y)?rn:""])},[(E(!0),O(mt,null,Ft(y.promptBlocks,(be,ze)=>(E(),O(mt,{key:`${y.id}-prompt-${ze}`},[be.type==="text"||be.type==="imported_text"?(E(),O("pre",xf,A(be.content),1)):(E(),O("div",vf,[p("div",yf,[ie(l(fo),{class:"h-3.5 w-3.5"}),p("span",null,A(l(fe)("sessionPanel.promptImage")),1)]),p("div",kf,[p("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:We=>ct(be.content)},[p("img",{src:be.content,alt:l(fe)("sessionPanel.promptImageAlt"),class:"max-h-52 w-auto max-w-full rounded-sm object-contain"},null,8,Sf)],8,_f)])]))],64))),128))],2)):(E(),O("pre",{key:1,class:Se(["whitespace-pre-wrap break-all font-sans leading-7",l(Ze)(y)&&l(it)(y)?rn:""])},A(y.prompt),3)),l(Ze)(y)&&l(it)(y)?(E(),O("div",wf)):ve("",!0)])])]),p("div",Tf,[p("div",{class:Se(["transcript-card transcript-card--process min-w-0 w-full max-w-[94%] rounded-sm border border-dashed px-4 py-3",l(a)(y)])},[p("div",Cf,[p("span",null,A(l(fe)("sessionPanel.processTitle")),1),p("div",Ef,[l(Le)(y)?(E(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",disabled:y.eventsLoading,onClick:be=>l(st)(y)},[y.eventsLoading?(E(),we(l(Ot),{key:0,class:"h-3 w-3 animate-spin"})):l(St)(y)?(E(),we(l(Lu),{key:1,class:"h-3 w-3"})):(E(),we(l(Mn),{key:2,class:"h-3 w-3"})),p("span",null,A(y.eventsLoading?l(fe)("sessionPanel.loading"):l(St)(y)?`${l(fe)("sessionPanel.expand")} (${l(Be)(y)})`:l(fe)("sessionPanel.collapse")),1)],8,Af)):ve("",!0),p("span",null,A(l(d)(y)),1)])]),y.eventsLoading&&!y.events.length?(E(),O("div",Df,A(l(fe)("sessionPanel.loadingEvents")),1)):y.events.length&&!l(St)(y)?(E(),O("div",If,[(E(!0),O(mt,null,Ft(y.events,be=>(E(),O("div",{key:be.id,class:Se(["transcript-event-card rounded-sm border border-dashed px-3 py-2",{"border-[var(--theme-borderMuted)] bg-[var(--theme-appPanelStrong)]":be.kind==="info"||be.kind==="command","theme-status-warning":be.kind==="todo","theme-status-success":be.kind==="result","theme-status-danger":be.kind==="error"}])},[p("div",Ff,A(be.title),1),be.detail?(E(),O("pre",$f,A(be.detail),1)):ve("",!0)],2))),128))])):l(Le)(y)?(E(),O("div",Mf,A(y.eventsLoaded?l(fe)("sessionPanel.hiddenEventsLoaded",{count:l(Be)(y)}):l(fe)("sessionPanel.hiddenEventsLoadLater",{count:l(Be)(y)})),1)):(E(),O("p",Pf,A(["queued","starting","running","stopping"].includes(y.status)?l(fe)("sessionPanel.waitingEvents",{agent:l(c)(y)}):l(fe)("sessionPanel.noEvents")),1)),l(ye)(y)?(E(),O("div",Bf,[p("div",Rf,[p("div",Lf,[l(_)(y)?(E(),O("div",Nf,A(l(_)(y)),1)):ve("",!0),l(m)(y)?(E(),O("div",Of,A(l(m)(y)),1)):ve("",!0),l(f)(y).length?(E(),O("div",zf,[(E(!0),O(mt,null,Ft(l(f)(y),be=>(E(),O("span",{key:be.key,class:"transcript-card__pill inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1"},[p("span",qf,A(be.label),1),p("span",Uf,A(be.value),1)]))),128))])):ve("",!0)]),e.diffSupported&&y.runId?(E(),O("button",{key:0,type:"button",class:"transcript-card__toggle shrink-0 inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:be=>bt(y)},[ie(l($o),{class:"h-3 w-3"}),p("span",null,A(l(fe)("sessionPanel.view")),1)],8,jf)):ve("",!0)])])):ve("",!0)],2)]),l(T)(y)?(E(),O("div",Vf,[p("div",{class:Se(["transcript-card transcript-card--response min-w-0 w-full max-w-[92%] rounded-sm border border-dashed px-4 py-3 text-sm leading-7",y.errorMessage?"border-[var(--theme-danger)] bg-[var(--theme-dangerSoft)] text-[var(--theme-dangerText)]":"border-[var(--theme-responseBorder)] bg-[var(--theme-responseBg)] text-[var(--theme-responseText)]"])},[p("div",Hf,[p("span",null,A(y.errorMessage?l(fe)("sessionPanel.errorSuffix",{agent:l(c)(y)}):l(fe)("sessionPanel.responseSuffix",{agent:l(c)(y)})),1),l(Ye)(y)?(E(),O("button",{key:0,type:"button",class:"transcript-card__toggle inline-flex items-center gap-1 rounded-sm border border-dashed border-current/30 px-2 py-1 text-[11px] transition hover:bg-white/15",onClick:be=>l(et)(y)},[l(Xe)(y)?(E(),we(l(Lu),{key:0,class:"h-3 w-3"})):(E(),we(l(Mn),{key:1,class:"h-3 w-3"})),p("span",null,A(l(Xe)(y)?l(fe)("sessionPanel.expand"):l(fe)("sessionPanel.collapse")),1)],8,Wf)):ve("",!0)]),p("div",Kf,[y.errorMessage?(E(),O("div",{key:0,class:Se([l(Ye)(y)&&l(Xe)(y)?rn:"","whitespace-pre-wrap break-all"])},A(y.errorMessage),3)):(E(),O("div",{key:1,class:Se(["prose-like codex-markdown",l(Ye)(y)&&l(Xe)(y)?rn:""]),innerHTML:Ke(y)},null,10,Gf)),l(Ye)(y)&&l(Xe)(y)?(E(),O("div",{key:2,class:Se(["pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-t",y.errorMessage?"from-[var(--theme-dangerSoft)] via-[var(--theme-dangerSoft)] to-transparent":"from-[var(--theme-responseBg)] via-[var(--theme-responseBg)] to-transparent"])},null,2)):ve("",!0)])],2)])):ve("",!0)]))),128))],544),p("div",Zf,[l(j)?(E(),O("button",{key:0,type:"button",class:"tool-button pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",onClick:xe[8]||(xe[8]=(...y)=>l(_e)&&l(_e)(...y))},[ie(l(wi),{class:"h-3.5 w-3.5"}),p("span",null,A(l(fe)("sessionPanel.jumpToLatest")),1)])):ve("",!0),l(me)?(E(),O("button",{key:1,type:"button",class:"tool-button tool-button-warning-subtle pointer-events-auto inline-flex items-center gap-1.5 border-[var(--theme-borderStrong)] bg-[var(--theme-appOverlay)] px-2.5 py-1.5 text-[11px] shadow-sm backdrop-blur",disabled:l(ce),onClick:xe[9]||(xe[9]=(...y)=>l(U)&&l(U)(...y))},[l(ce)?(E(),we(l(Ot),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(E(),we(l($i),{key:1,class:"h-3.5 w-3.5"})),p("span",null,A(l(ce)?l(fe)("sessionPanel.stopping"):l(fe)("sessionPanel.stop")),1),l(ce)?ve("",!0):(E(),O("span",Yf,[...xe[11]||(xe[11]=[p("span",{class:"task-loading-dots__dot"},null,-1),p("span",{class:"task-loading-dots__dot"},null,-1),p("span",{class:"task-loading-dots__dot"},null,-1)])]))],8,Xf)):ve("",!0)])]),ie(Dr,{modelValue:$e.value,"onUpdate:modelValue":xe[10]||(xe[10]=y=>$e.value=y),images:qe.value},null,8,["modelValue","images"])]))}},Qf={key:0,class:"h-full min-h-0"},e1={key:1,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},dr={__name:"WorkbenchActivityPanel",props:{taskSlug:{type:String,default:""},buildPrompt:{type:Function,default:null},buildPromptBlocks:{type:Function,default:null},selectedSessionId:{type:String,default:""},sessionSelectionLocked:{type:Boolean,default:!1},sessionSelectionLockReason:{type:String,default:""},diffSupported:{type:Boolean,default:!1},taskRunning:{type:Boolean,default:!1},emptyMessage:{type:String,default:""}},emits:["sending-change","project-created","selected-session-change","open-diff"],setup(e,{expose:t,emit:u}){const n=u,r=H(null);function o(){var a,d;return(d=(a=r.value)==null?void 0:a.send)==null?void 0:d.call(a)}function i(){var a,d;(d=(a=r.value)==null?void 0:a.stop)==null||d.call(a)}function s(){var a,d;(d=(a=r.value)==null?void 0:a.scrollToBottom)==null||d.call(a)}return t({send:o,stop:i,scrollToBottom:s}),(a,d)=>e.taskSlug?(E(),O("div",Qf,[ie(Jf,{ref_key:"panelRef",ref:r,active:!!e.taskSlug,"task-slug":e.taskSlug,"build-prompt":e.buildPrompt||(()=>""),"build-prompt-blocks":e.buildPromptBlocks||(()=>[]),"selected-session-id":e.selectedSessionId,"session-selection-locked":e.sessionSelectionLocked,"session-selection-lock-reason":e.sessionSelectionLockReason,"diff-supported":e.diffSupported,"task-running":e.taskRunning,onProjectCreated:d[0]||(d[0]=c=>n("project-created",c)),onSendingChange:d[1]||(d[1]=c=>n("sending-change",c)),onSelectedSessionChange:d[2]||(d[2]=c=>n("selected-session-change",c)),onOpenDiff:d[3]||(d[3]=c=>n("open-diff",c))},null,8,["active","task-slug","build-prompt","build-prompt-blocks","selected-session-id","session-selection-locked","session-selection-lock-reason","diff-supported","task-running"])])):e.emptyMessage?(E(),O("section",e1,A(e.emptyMessage),1)):ve("",!0)}};function t1(e){const{activeIndex:t,blocks:u,isTextLikeBlock:n,placeCursor:r,resizeAllTextareas:o,selectionMap:i,sessionId:s,setBlocks:a,textareas:d}=e,c=H(_()),f=H(null),m=H(null);function _(){return{open:!1,blockIndex:-1,start:0,end:0,query:"",trigger:"mention"}}function g(N,q){const ue=d.value[N];if(!ue||typeof document>"u")return null;const ae=window.getComputedStyle(ue),me=document.createElement("div"),ce=document.createElement("span"),ye=["boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];me.style.position="fixed",me.style.left="-9999px",me.style.top="0",me.style.visibility="hidden",me.style.whiteSpace="pre-wrap",me.style.wordWrap="break-word",ye.forEach(J=>{me.style[J]=ae[J]});const j=ue.value.slice(0,q),K=ue.value.slice(q,q+1)||" ",T=ue.value.slice(q+1);me.textContent=j,ce.textContent=K,me.appendChild(ce),T&&me.appendChild(document.createTextNode(T)),document.body.appendChild(me);const X=ue.getBoundingClientRect(),de=Number.parseFloat(ae.lineHeight)||Number.parseFloat(ae.fontSize)*1.4||20,U=X.left+ce.offsetLeft-ue.scrollLeft,W=X.top+ce.offsetTop-ue.scrollTop;return document.body.removeChild(me),{left:U,top:W,right:U,bottom:W+de,width:0,height:de}}function F(N,q){return!N&&!q?!1:!N||!q?!0:Math.abs((N.left||0)-(q.left||0))>=1||Math.abs((N.top||0)-(q.top||0))>=1||Math.abs((N.bottom||0)-(q.bottom||0))>=1}function B(){const N=c.value;if(!N.open||N.blockIndex<0){f.value=null;return}const q=g(N.blockIndex,N.start);F(q,f.value)&&(f.value=q)}function v(N){const q=Number(N==null?void 0:N.blockIndex);if(q<0)return;const ue=u.value[q];if(!ue||!n(ue))return;const ae=Math.max(0,Number(N.start)||0),me=Math.max(ae,Number(N.end)||ae),ce=`${ue.content.slice(0,ae)}${ue.content.slice(me)}`,ye=[...u.value];ye.splice(q,1,{...ue,content:ce}),a(ye),t.value=q,i.value[q]={start:ae,end:ae},De(()=>r(q,ae))}function x(N={}){const{suppressCurrent:q=!1,cleanupShortcut:ue=!1}=N,ae=c.value;q&&ae.open&&(m.value={blockIndex:ae.blockIndex,start:ae.start,end:ae.end,query:ae.query,trigger:ae.trigger}),c.value=_(),f.value=null,ue&&ae.trigger==="shortcut"&&v(ae)}function D(){x({suppressCurrent:!0,cleanupShortcut:c.value.trigger==="shortcut"})}function L(N,q){const ue=q||d.value[N],ae=u.value[N];if(!ue||!ae||!n(ae)){c.value.blockIndex===N&&x();return}const me=ue.selectionStart??0,ce=ue.selectionEnd??0;if(me!==ce){c.value.blockIndex===N&&x();return}const j=String(ae.content||"").slice(0,ce),K=j.lastIndexOf("@");if(K<0){c.value.blockIndex===N&&x();return}const T=j.slice(K+1);if(/\s/.test(T)){c.value.blockIndex===N&&x();return}const X=K,de=m.value;if(de&&de.blockIndex===N&&de.start===X&&de.end===ce&&de.query===T)return;m.value=null;const U=!c.value.open||c.value.blockIndex!==N||c.value.start!==X,W=g(N,X),J=c.value.open&&c.value.blockIndex===N&&c.value.start===X&&c.value.trigger||"mention";c.value={open:!0,blockIndex:N,start:X,end:ce,query:T,trigger:J},(U||F(W,f.value))&&(f.value=W)}function $(N,q){i.value[N]={start:q.target.selectionStart??0,end:q.target.selectionEnd??0},L(N,q.target)}function te(N){t.value=N;const q=d.value[N];i.value[N]={start:(q==null?void 0:q.selectionStart)??0,end:(q==null?void 0:q.selectionEnd)??0},L(N,q)}function C(){var X,de;const N=Math.min(t.value??0,Math.max(u.value.length-1,0)),q=u.value[N];if(!q||!n(q))return!1;const ue=d.value[N],ae=q.content.length,me={start:(ue==null?void 0:ue.selectionStart)??((X=i.value[N])==null?void 0:X.start)??ae,end:(ue==null?void 0:ue.selectionEnd)??((de=i.value[N])==null?void 0:de.end)??ae},ce=Math.max(0,me.start??0),ye=Math.max(ce,me.end??ce),j=`${q.content.slice(0,ce)}@${q.content.slice(ye)}`,K=ce+1,T=[...u.value];return T.splice(N,1,{...q,content:j}),a(T),t.value=N,i.value[N]={start:K,end:K},m.value=null,De(()=>{r(N,K),c.value={open:!0,blockIndex:N,start:ce,end:K,query:"",trigger:"shortcut"},f.value=g(N,ce)}),!0}function Q(N){const q=String((N==null?void 0:N.path)||"").trim(),ue=c.value;if(!q||ue.blockIndex<0)return x(),!1;const ae=u.value[ue.blockIndex];if(!ae||!n(ae))return x(),!1;const me=ue.trigger==="shortcut"?`${q} `:`@${q} `,ce=`${ae.content.slice(0,ue.start)}${me}${ae.content.slice(ue.end)}`,ye=ue.start+me.length,j=[...u.value];return j.splice(ue.blockIndex,1,{...ae,content:ce}),a(j),t.value=ue.blockIndex,i.value[ue.blockIndex]={start:ye,end:ye},m.value=null,x(),De(()=>r(ue.blockIndex,ye)),!0}function Y(){c.value.open&&B()}return Ee(()=>(s==null?void 0:s.value)??s,()=>{x()}),Ee(()=>c.value.open,N=>{N||De(()=>{o==null||o()})}),mu(()=>{window.addEventListener("resize",Y),window.addEventListener("scroll",Y)}),ft(()=>{window.removeEventListener("resize",Y),window.removeEventListener("scroll",Y)}),{mentionState:c,mentionAnchorRect:f,applyMentionSelection:Q,closeMentionPicker:x,dismissMentionPicker:D,handleTextFocus:te,openPathPickerFromShortcut:C,recordSelection:$,syncMentionState:L,updateMentionAnchor:B}}const pi=20;function sn(e,t){if(!e||!t)return 0;const u=e.getBoundingClientRect(),n=t.getBoundingClientRect();return u.top-n.top+t.scrollTop}function u1({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,align:r="nearest",padding:o=pi}={}){const i=Math.max(0,Number(o)||0),s=Math.max(0,Number(e)||0),a=Math.max(0,Number(t)||0),d=Math.max(0,Number(u)||0),c=Math.max(0,Number(n)||0),f=d+c;if(!a)return s;if(r==="end")return Math.max(0,f-a+i);const m=s+i,_=s+a-i;return d<m?Math.max(0,d-i):f>_?Math.max(0,f-a+i):s}function n1({containerScrollTop:e=0,containerClientHeight:t=0,targetTop:u=0,targetHeight:n=0,padding:r=pi}={}){const o=Math.max(0,Number(r)||0),i=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),a=Math.max(0,Number(u)||0),d=Math.max(0,Number(n)||0),c=a+d;if(!s)return!0;const f=i+o,m=i+s-o;return d>=Math.max(0,m-f)?c>f&&a<m:a>=f&&c<=m}function o1(e){const{props:t,panelRef:u,onClose:n}=e,r=H({left:"12px",top:"12px",width:"560px",maxHeight:"420px"}),o=H(!1),i=H("bottom");function s(){n==null||n()}function a(_=!1){const g=window.innerWidth,F=window.innerHeight,B=12,v=8,x=320,D=560,L=420,$=180,te=Math.min(D,Math.max(x,g-B*2)),C=Math.min(te,g-B*2),Q=t.anchorRect||{left:(g-C)/2,top:F/2,bottom:F/2};let Y=Q.left;Y+C>g-B&&(Y=g-B-C),Y<B&&(Y=B);const N=Math.max(0,F-B-(Q.bottom+v)),q=Math.max(0,Q.top-v-B);_?i.value=N>=q?"bottom":"top":i.value==="bottom"&&N<$&&q>N+24?i.value="top":i.value==="top"&&q<$&&N>q+24&&(i.value="bottom");const ue=i.value,ae=ue==="bottom"?N:q,me=Math.max(140,F-B*2),ce=Math.min(me,Math.max(Math.min(L,ae||L),$)),ye={left:`${Math.round(Y)}px`,width:`${Math.round(C)}px`,maxHeight:`${Math.round(ce)}px`,top:"auto",bottom:"auto"};return ue==="bottom"?ye.top=`${Math.round(Math.max(B,Q.bottom+v))}px`:ye.bottom=`${Math.round(Math.max(B,F-Q.top+v))}px`,ye}function d(_=!1){const g=a(_);r.value={...r.value,left:g.left,top:g.top,bottom:g.bottom,width:g.width,maxHeight:g.maxHeight}}function c(){return!t.open||!t.anchorRect?!1:(i.value="bottom",d(!0),o.value=!0,!0)}function f(){o.value=!1}function m(_){!t.open||!u.value||u.value.contains(_.target)||s()}return mu(()=>{document.addEventListener("pointerdown",m)}),ft(()=>{document.removeEventListener("pointerdown",m)}),{closePicker:s,initializePanel:c,panelReady:o,panelStyle:r,resetPanel:f,updatePanelPosition:d}}const Kn="promptx:codex-recent-paths",r1=12;function i1(e){const{props:t,onSelect:u}=e,n=H([]),r=H(!1),o=H(""),i=H([]),s=H(!1),a=H(""),d=H([]),c=H([]),f=H("tree"),m=H(""),_=new Map;let g=null,F=0,B=0;const v=le(()=>String(t.query||"").trim()),x=le(()=>!!v.value),D=le(()=>T(n.value)),L=le(()=>String(t.sessionId||"").trim()),$=le(()=>L.value?`promptx:codex-tree-expanded:${L.value}`:""),te=le(()=>{if(!v.value)return d.value;const R=new Set(i.value.map(V=>V.path));return d.value.filter(V=>R.has(V.path))}),C=le(()=>{const R=new Set(te.value.map(V=>V.path));return i.value.filter(V=>!R.has(V.path))}),Q=le(()=>v.value?[...te.value,...C.value]:d.value),Y=le(()=>f.value==="search"?Q.value:D.value),N=le(()=>f.value==="search"?s.value:r.value),q=le(()=>f.value==="search"?a.value:o.value),ue=le(()=>f.value==="search"&&!!t.sessionId&&!v.value&&!d.value.length),ae=le(()=>f.value==="search"&&!!t.sessionId&&!!v.value&&!s.value&&!a.value&&!Q.value.length),me=le(()=>f.value==="tree"&&!!t.sessionId&&!r.value&&!o.value&&!D.value.length);function ce(R,V){if(!R||typeof window>"u")return V;try{const se=window.localStorage.getItem(R);return se?JSON.parse(se):V}catch{return V}}function ye(R,V){if(!(!R||typeof window>"u"))try{window.localStorage.setItem(R,JSON.stringify(V))}catch{}}function j(R=[]){return[...R].sort((V,se)=>{const he=+(V.type!=="directory")-+(se.type!=="directory");return he||String(V.path||V.name||"").localeCompare(String(se.path||se.name||""),"zh-CN")})}function K(R){return{...R,children:[],expanded:!1,loaded:!1,loading:!1}}function T(R=[],V=0,se=[]){return R.forEach(he=>{se.push({...he,depth:V}),he.type==="directory"&&he.expanded&&he.children.length&&T(he.children,V+1,se)}),se}function X(R,V=n.value){for(const se of V){if(se.path===R)return se;if(se.children.length){const he=X(R,se.children);if(he)return he}}return null}function de(){n.value=[...n.value]}function U(R=n.value,V=[]){return R.forEach(se=>{se.type==="directory"&&se.expanded&&(V.push(se.path),se.children.length&&U(se.children,V))}),V}function W(){if(!$.value)return;const R=[...new Set(U())];c.value=R,ye($.value,R)}function J(){c.value=$.value?ce($.value,[]).filter(Boolean):[]}function ge(){const R=ce(Kn,[]);if(!Array.isArray(R)||!L.value){d.value=[];return}d.value=R.filter(V=>V&&V.sessionId===L.value&&V.path).sort((V,se)=>Number(se.usedAt||0)-Number(V.usedAt||0)).slice(0,r1)}function oe(R){return R.name||R.path||"."}function Ie(R){return R.path||"."}function _e(R){if(!L.value||!(R!=null&&R.path))return;const V={sessionId:L.value,path:R.path,name:R.name||oe(R),type:R.type||"file",usedAt:Date.now()},se=ce(Kn,[]),he=[V];Array.isArray(se)&&se.forEach(Ce=>{!(Ce!=null&&Ce.path)||!(Ce!=null&&Ce.sessionId)||Ce.sessionId===V.sessionId&&Ce.path===V.path||he.push(Ce)}),ye(Kn,he.slice(0,40)),ge()}function Me(R=""){const V=String(R||"").trim();return!V||!V.includes("/")?"":V.slice(0,V.lastIndexOf("/"))}function $e(){const R=Y.value;if(!R.length)return-1;const V=R.findIndex(se=>se.path===m.value);return V>=0?V:0}function fe(){const R=Y.value,V=$e();return V<0||!R.length?null:R[V]||null}function Ze(){const R=Y.value;if(!R.length){m.value="";return}R.some(V=>V.path===m.value)||(m.value=R[0].path)}function Ye(R,V){if(V){_.set(R,V);return}_.delete(R)}function Be(){var V;const R=_.get(m.value);(V=R==null?void 0:R.scrollIntoView)==null||V.call(R,{block:"nearest"})}function Le(R=""){return String(R||"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function it(R="",V=""){const se=String(R||""),he=String(V||"").trim().toLowerCase();if(!se||!he)return null;const Ce=se.toLowerCase(),Dt=Ce.indexOf(he);if(Dt>=0)return{start:Dt,end:Dt+he.length};const tu=he.split(/[\\/\s_.-]+/).filter(Boolean).sort((Mt,Tt)=>Tt.length-Mt.length);for(const Mt of tu){if(Mt.length<2)continue;const Tt=Ce.indexOf(Mt);if(Tt>=0)return{start:Tt,end:Tt+Mt.length}}return null}function Xe(R="",V=""){const se=String(R||""),he=it(se,V);return he?`${Le(se.slice(0,he.start))}<mark class="theme-search-highlight">${Le(se.slice(he.start,he.end))}</mark>${Le(se.slice(he.end))}`:Le(se)}function St(R){return Xe(oe(R),v.value)}function gt(R){return Xe(Ie(R),v.value)}async function et(R="",V={}){if(!t.sessionId){n.value=[],o.value="",r.value=!1;return}const se=!R,he=se?null:X(R);if(!(!se&&!he)&&!(!V.force&&(se&&n.value.length||!se&&he.loaded))){se?(r.value=!0,o.value=""):(he.loading=!0,o.value="",de());try{const Ce=await Ms(t.sessionId,{path:R,refreshToken:V.refreshToken||""}),Dt=j(Ce.items||[]).map(K);if(se){n.value=Dt;return}he.children=Dt,he.loaded=!0}catch(Ce){o.value=Ce.message}finally{se?r.value=!1:(he.loading=!1,de())}}}async function st(R=n.value,V=new Set,se={}){for(const he of R)he.type!=="directory"||!V.has(he.path)||(he.expanded=!0,de(),await et(he.path,se),he.children.length&&await st(he.children,V,se))}async function lt(R={}){await et("",R);const V=new Set(c.value),se=V.size>0;for(const Ce of n.value)Ce.type!=="directory"||!Ce.hasChildren||(Ce.expanded=se?V.has(Ce.path):!0);if(de(),se){await st(n.value,V,R);return}const he=n.value.filter(Ce=>Ce.type==="directory"&&Ce.expanded&&Ce.hasChildren);await Promise.all(he.map(Ce=>et(Ce.path,R))),W()}async function bt(R){if(f.value!=="tree")return;const V=X(R);if(!(!V||V.type!=="directory")){if(!V.loaded&&!V.loading){V.expanded=!0,de(),await et(V.path),W();return}V.expanded=!V.expanded,de(),W()}}function xt(R){return R!=null&&R.path?(_e(R),u==null||u(R),!0):!1}async function Ke(R={}){const V=v.value;F+=1;const se=F,he=R.refreshToken||"";if(!t.open||!t.sessionId||!V){s.value=!1,a.value="",V||(i.value=[]);return}try{const Ce=await Ps(t.sessionId,V,{limit:80,refreshToken:he});if(se!==F)return;i.value=Ce.items||[]}catch(Ce){if(se!==F)return;a.value=Ce.message,i.value=[]}finally{se===F&&(s.value=!1)}}function ct(R={}){if(g&&(window.clearTimeout(g),g=null),!t.open||!t.sessionId||!v.value){s.value=!1,a.value="",v.value||(i.value=[]);return}s.value=!0,a.value="",g=window.setTimeout(()=>{Ke(R)},120)}function qe(){if(!t.sessionId){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1;return}B=Date.now(),n.value=[],o.value="",i.value=[],a.value="",lt({force:!0,refreshToken:B}),ct({refreshToken:B})}function Te(){ge(),J(),y(x.value?"search":"tree"),qe()}function xe(){g&&(window.clearTimeout(g),g=null),i.value=[],a.value="",s.value=!1}function y(R){f.value=R,R==="tree"&&t.sessionId&&!r.value&&!n.value.length&&lt({force:!0}),De(()=>{Ze(),Be()})}function be(R){const V=Y.value;if(!V.length)return!1;const se=$e(),he=se<0?0:(se+R+V.length)%V.length;return m.value=V[he].path,!0}async function ze(){if(f.value!=="tree")return!1;const R=fe();if(!R||R.type!=="directory")return!1;if(!R.expanded)return await bt(R.path),m.value=R.path,!0;const V=Y.value,se=$e(),he=V[se+1];return he&&Me(he.path)===R.path?(m.value=he.path,!0):!1}function We(){if(f.value!=="tree")return!1;const R=fe();if(!R)return!1;if(R.type==="directory"&&R.expanded){const se=X(R.path);return se&&(se.expanded=!1,de(),W()),m.value=R.path,!0}const V=Me(R.path);return V?(m.value=V,!0):!1}function wt(){const R=Y.value;return R.length?xt(R[$e()]):!1}function Ut(R=1){const V=["search","tree"],se=V.indexOf(f.value),he=se<0?0:(se+R+V.length)%V.length;return y(V[he]),!0}function dt(){n.value=[],o.value="",r.value=!1,i.value=[],a.value="",s.value=!1,ge(),J(),t.sessionId&&t.open&&(lt({force:!0}),ct())}function Rt(){y(x.value?"search":"tree"),ct()}function at(){Ze(),De(Be)}return ft(()=>{g&&window.clearTimeout(g)}),{activeKey:m,activeTab:f,collapseActiveDirectory:We,confirmActive:wt,currentError:q,currentLoading:N,emitSelect:xt,expandActiveDirectory:ze,getDisplayName:oe,getHighlightedName:St,getHighlightedPath:gt,handleQueryChange:Rt,handleSessionChange:dt,handleVisibleItemsChange:at,initializeData:Te,moveActive:be,normalSearchItems:C,normalizedQuery:v,recentSearchItems:te,resetData:xe,setActiveTab:y,setItemRef:Ye,showSearchEmptyState:ae,showSearchPromptState:ue,showTreeEmptyState:me,switchTab:Ut,toggleDirectory:bt,treeItems:D,visibleItems:Y}}function s1(e){const{props:t,panelRef:u,onClose:n,onSelect:r}=e,{closePicker:o,initializePanel:i,panelReady:s,panelStyle:a,resetPanel:d,updatePanelPosition:c}=o1({props:t,panelRef:u,onClose:n}),f=i1({props:t,onSelect:r});return Ee(()=>t.open,m=>{if(!m){f.resetData(),d();return}d(),t.anchorRect&&i()&&f.initializeData()},{flush:"sync"}),Ee(()=>t.anchorRect,m=>{if(!(!t.open||!m)){if(!s.value){i()&&f.initializeData();return}c(!1)}},{flush:"sync"}),Ee(()=>t.sessionId,()=>{f.handleSessionChange()},{flush:"sync",immediate:!0}),Ee(()=>t.query,()=>{f.handleQueryChange()},{immediate:!0}),Ee(f.visibleItems,()=>{f.handleVisibleItemsChange()},{immediate:!0}),Ee(()=>f.activeKey.value,()=>{f.handleVisibleItemsChange()}),{...f,closePicker:o,panelReady:s,panelStyle:a}}const a1={class:"theme-divider flex items-center justify-between gap-2 border-b border-dashed px-2.5 py-2"},l1={class:"flex items-center gap-1.5"},c1={class:"flex shrink-0 items-center gap-2"},d1={class:"min-h-0 flex-1 overflow-y-auto p-2"},f1={key:0,class:"theme-empty-state px-3 py-4 text-xs"},p1={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},h1={key:2,class:"theme-empty-state px-3 py-4 text-xs"},m1={key:3,class:"theme-empty-state px-3 py-4 text-xs"},g1={key:4,class:"theme-empty-state px-3 py-4 text-xs"},b1={key:5,class:"theme-empty-state px-3 py-4 text-xs"},x1={key:6,class:"space-y-1"},v1={key:0,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},y1=["onMouseenter","onClick"],k1={class:"min-w-0 flex-1"},_1=["innerHTML"],S1=["innerHTML"],w1={key:1,class:"theme-muted-text px-1 py-0.5 text-[10px] uppercase tracking-[0.12em]"},T1=["onMouseenter","onClick"],C1={class:"min-w-0 flex-1"},E1=["innerHTML"],A1=["innerHTML"],D1={key:7,class:"space-y-1"},I1=["onMouseenter"],F1={class:"flex items-start gap-1.5"},$1=["onClick"],M1={key:1,class:"block h-5 w-5 shrink-0"},P1=["onClick"],B1={class:"min-w-0 flex-1"},R1={class:"flex items-center gap-1.5"},L1={__name:"PathMentionPicker",props:{open:{type:Boolean,default:!1},sessionId:{type:String,default:""},query:{type:String,default:""},anchorRect:{type:Object,default:null}},emits:["close","select"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=H(null),{t:i}=_t(),{activeKey:s,activeTab:a,closePicker:d,collapseActiveDirectory:c,confirmActive:f,currentError:m,currentLoading:_,emitSelect:g,expandActiveDirectory:F,getDisplayName:B,getHighlightedName:v,getHighlightedPath:x,moveActive:D,normalSearchItems:L,normalizedQuery:$,panelReady:te,panelStyle:C,recentSearchItems:Q,setActiveTab:Y,setItemRef:N,showSearchEmptyState:q,showSearchPromptState:ue,showTreeEmptyState:ae,switchTab:me,toggleDirectory:ce,treeItems:ye,visibleItems:j}=s1({props:n,panelRef:o,onClose:()=>r("close"),onSelect:K=>r("select",K)});return t({collapseActiveDirectory:c,moveActive:D,confirmActive:f,expandActiveDirectory:F,switchTab:me}),(K,T)=>(E(),we(hu,{to:"body"},[e.open&&l(te)?(E(),O("div",{key:0,ref_key:"panelRef",ref:o,class:"theme-popover fixed z-40 flex flex-col overflow-hidden rounded-sm border shadow-lg",style:gn(l(C))},[p("div",a1,[p("div",l1,[p("button",{type:"button",class:Se(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",l(a)==="search"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:T[0]||(T[0]=X=>l(Y)("search"))},[ie(l(Bi),{class:"h-3.5 w-3.5"}),p("span",null,A(l(i)("pathPicker.searchTab")),1)],2),p("button",{type:"button",class:Se(["inline-flex h-7 items-center gap-1 rounded-sm border px-2 text-[11px] transition",l(a)==="tree"?"tool-button-accent-subtle":"theme-filter-idle border-dashed"]),onClick:T[1]||(T[1]=X=>l(Y)("tree"))},[ie(l(tn),{class:"h-3.5 w-3.5"}),p("span",null,A(l(i)("pathPicker.treeTab")),1)],2)]),p("div",c1,[p("div",{class:Se(["theme-muted-text inline-flex h-7 w-7 items-center justify-center",l(_)?"opacity-100":"opacity-0"])},[ie(l(Ot),{class:"h-3.5 w-3.5 animate-spin"})],2),p("button",{type:"button",class:"tool-button inline-flex h-7 w-7 items-center justify-center",onClick:T[2]||(T[2]=(...X)=>l(d)&&l(d)(...X))},[ie(l(Cn),{class:"h-4 w-4"})])])]),p("div",d1,[e.sessionId?l(m)?(E(),O("div",p1,A(l(m)),1)):l(ue)?(E(),O("div",h1,A(l(i)("pathPicker.searchPrompt")),1)):l(q)?(E(),O("div",m1,A(l(i)("pathPicker.noResults")),1)):l(ae)?(E(),O("div",g1,A(l(i)("pathPicker.emptyDirectory")),1)):l(_)&&!l(j).length?(E(),O("div",b1,A(l(i)("pathPicker.loading")),1)):l(a)==="search"?(E(),O("div",x1,[l(Q).length?(E(),O("div",v1,A(l(i)("pathPicker.recent")),1)):ve("",!0),(E(!0),O(mt,null,Ft(l(Q),X=>(E(),O("button",{key:X.path,ref_for:!0,ref:de=>l(N)(X.path,de),type:"button",class:Se(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",l(s)===X.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:de=>s.value=X.path,onClick:de=>l(g)(X)},[(E(),we(ln(X.type==="directory"?l(tn):l(Pn)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),p("div",k1,[p("div",null,[p("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:l(v)(X)},null,8,_1)]),p("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:l(x)(X)},null,8,S1)])],42,y1))),128)),l($)&&l(L).length?(E(),O("div",w1,A(l(i)("pathPicker.results")),1)):ve("",!0),(E(!0),O(mt,null,Ft(l(L),X=>(E(),O("button",{key:X.path,ref_for:!0,ref:de=>l(N)(X.path,de),type:"button",class:Se(["flex w-full items-start gap-2 rounded-sm border border-transparent px-2.5 py-1.5 text-left transition",l(s)===X.path?"theme-list-item-active":"theme-list-item-hover"]),onMouseenter:de=>s.value=X.path,onClick:de=>l(g)(X)},[(E(),we(ln(X.type==="directory"?l(tn):l(Pn)),{class:"theme-muted-text mt-0.5 h-4 w-4 shrink-0"})),p("div",C1,[p("div",null,[p("span",{class:"truncate text-[13px] text-[var(--theme-textPrimary)]",innerHTML:l(v)(X)},null,8,E1)]),p("div",{class:"theme-muted-text truncate font-mono text-[10px]",innerHTML:l(x)(X)},null,8,A1)])],42,T1))),128))])):(E(),O("div",D1,[(E(!0),O(mt,null,Ft(l(ye),X=>(E(),O("div",{key:X.path,ref_for:!0,ref:de=>l(N)(X.path,de),class:Se(["rounded-sm border border-transparent px-1.5 py-1 transition",l(s)===X.path?"theme-list-item-active":X.type==="directory"&&X.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:gn({paddingLeft:`${X.depth*16+6}px`}),onMouseenter:de=>s.value=X.path},[p("div",F1,[X.type==="directory"?(E(),O("button",{key:0,type:"button",class:"theme-icon-button h-5 w-5 shrink-0",onClick:Ve(de=>l(ce)(X.path),["stop"])},[X.loading?(E(),we(l(Ot),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(E(),we(l(Ii),{key:1,class:Se(["h-3.5 w-3.5 transition",X.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],8,$1)):(E(),O("span",M1)),p("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:de=>l(g)(X)},[(E(),we(ln(X.type==="directory"?l(tn):l(Pn)),{class:Se(["h-4 w-4 shrink-0",X.type==="directory"&&X.expanded?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"])),p("div",B1,[p("div",R1,[p("span",{class:Se(["truncate text-[13px]",X.type==="directory"?"font-medium text-[var(--theme-textPrimary)]":"text-[var(--theme-textPrimary)]"])},A(l(B)(X)),3)])])],8,P1)])],46,I1))),128))])):(E(),O("div",f1,A(l(i)("pathPicker.selectProjectFirst")),1))])],4)):ve("",!0)]))}},N1={class:"theme-divider theme-secondary-text border-b px-5 py-4 text-sm"},O1={class:"flex flex-wrap items-center justify-between gap-3"},z1={class:"theme-heading inline-flex items-center gap-2 font-medium"},q1={class:"grid w-full grid-cols-3 gap-2 sm:flex sm:w-auto sm:flex-wrap sm:items-center sm:justify-end"},U1={key:0,class:"group relative"},j1=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],V1=["onClick"],H1={key:1,class:"group relative dashed-panel overflow-hidden"},W1={class:"theme-divider theme-secondary-text flex items-start justify-between gap-3 border-b border-dashed px-4 py-3 text-xs"},K1={class:"min-w-0 pr-24"},G1={class:"theme-heading font-medium"},Z1={class:"mt-1 truncate font-mono"},X1={class:"mt-1"},Y1={class:"absolute right-3 top-3 flex flex-wrap gap-2 opacity-0 transition group-hover:opacity-100 focus-within:opacity-100"},J1=["onClick"],Q1=["onClick"],ep=["onClick"],tp={key:0,class:"theme-secondary-text px-4 py-3 text-sm leading-7"},up={key:0},np=["value","placeholder","onFocus","onBlur","onInput","onCompositionstart","onCompositionupdate","onCompositionend","onKeydown","onClick","onKeyup","onSelect"],op={key:2,class:"group relative"},rp=["onClick"],ip=["onClick"],sp={class:"theme-divider theme-muted-text flex items-center gap-2 border-b px-4 py-3 text-xs"},ap={class:"mx-auto flex w-full max-w-[720px] justify-center px-4 py-4"},lp=["onClick"],cp=["src","alt"],dp=1500,fp={__name:"BlockEditor",props:{modelValue:{type:Array,required:!0},codexSessionId:{type:String,default:""},uploading:{type:Boolean,default:!1}},emits:["update:modelValue","upload-files","import-text-files","import-pdf-files","clear-request"],setup(e,{expose:t,emit:u}){const n=e,r=u,{t:o}=_t(),i=le(()=>n.modelValue),s=le(()=>n.codexSessionId),a=H(0),d=H([]),c=H(-1),f=H(-1),m=H(null),_=H(null),g=H(null),F=H(null),B=H(null),v=H({}),x=H(""),D=H(0),L=H(-1),$=H("nearest"),te=H("visible"),C=H(null);let Q=null,Y=null,N=0,q=0;const{mentionState:ue,mentionAnchorRect:ae,applyMentionSelection:me,closeMentionPicker:ce,dismissMentionPicker:ye,handleTextFocus:j,openPathPickerFromShortcut:K,recordSelection:T,syncMentionState:X,updateMentionAnchor:de}=t1({activeIndex:a,blocks:i,isTextLikeBlock:J,placeCursor:y,resizeAllTextareas:Be,selectionMap:v,sessionId:s,setBlocks:fe,textareas:d}),U=le(()=>i.value.filter(h=>(h==null?void 0:h.type)===Pe.IMAGE&&String(h.content||"").trim()).map(h=>String(h.content||"").trim()));function W(h){return(h==null?void 0:h.type)===Pe.TEXT}function J(h){return(h==null?void 0:h.type)===Pe.TEXT||(h==null?void 0:h.type)===Pe.IMPORTED_TEXT}function ge(h){return h&&h.type!==Pe.TEXT}function oe(){var h,b;return((b=(h=globalThis.crypto)==null?void 0:h.randomUUID)==null?void 0:b.call(h))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function Ie(h={}){return{...h,clientId:String((h==null?void 0:h.clientId)||(h==null?void 0:h.id)||oe()),meta:h!=null&&h.meta?{...h.meta}:{}}}function _e(h=""){return Ie({type:Pe.TEXT,content:h,meta:{}})}function Me(h=[]){const b=Array.isArray(h)?h.filter(Boolean):[];if(!b.length)return[_e("")];const w=[];return b.forEach((M,ee)=>{const pe=Ie(M),I=w[w.length-1];!I&&ge(pe)&&w.push(_e("")),I&&ge(I)&&ge(pe)&&w.push(_e("")),w.push(pe),ee===b.length-1&&ge(pe)&&w.push(_e(""))}),w}function $e(h=[],b=[]){return h===b?!0:!Array.isArray(h)||!Array.isArray(b)||h.length!==b.length?!1:h.every((w,M)=>{var pe,I,Z,G;const ee=b[M];return!ee||(w==null?void 0:w.type)!==ee.type||(w==null?void 0:w.content)!==ee.content?!1:(((pe=w==null?void 0:w.meta)==null?void 0:pe.fileName)||"")===(((I=ee.meta)==null?void 0:I.fileName)||"")&&!!((Z=w==null?void 0:w.meta)!=null&&Z.collapsed)==!!((G=ee.meta)!=null&&G.collapsed)})}function fe(h){r("update:modelValue",Me(h))}function Ze(h,b){if(h){if(d.value[b]===h)return;d.value[b]=h,Ye(h);return}d.value[b]=null}function Ye(h,b={}){if(!h)return;const{allowShrink:w=!0,preserveViewport:M=!0,preserveSelection:ee=!0}=b,pe=window.scrollX,I=window.scrollY,Z=h.selectionStart,G=h.selectionEnd,Ue=document.activeElement===h,je=Number.parseFloat(h.style.height)||h.offsetHeight||40;w?(h.style.height="auto",h.style.height=`${Math.max(h.scrollHeight,40)}px`):h.style.height=`${Math.max(je,h.scrollHeight,40)}px`,ee&&Ue&&Z!==null&&G!==null&&h.setSelectionRange(Z,G),M&&(window.scrollX!==pe||window.scrollY!==I)&&window.scrollTo(pe,I)}function Be(){d.value.forEach(h=>Ye(h))}function Le(){if(Date.now()<=q)return;const h=L.value;h<0||st(h)||Xe()}function it(){Q&&(window.clearTimeout(Q),Q=null)}function Xe(){var h;L.value=-1,$.value="nearest",te.value="visible",C.value=null,it(),N&&((h=window.cancelAnimationFrame)==null||h.call(window,N),N=0)}function St(h=8e3){it();const b=Math.max(0,Number(h)||0);b&&(Q=window.setTimeout(()=>{Xe()},b))}function gt(){Y&&(Y.disconnect(),Y=null)}function et(h){const b=_.value;if(!b)return;const w=Math.max(0,Number(h)||0);Math.abs(b.scrollTop-w)<1||(q=Date.now()+120,b.scrollTop=w)}function st(h,b={}){const w=_.value,M=d.value[h];return!w||!M?!1:n1({containerScrollTop:w.scrollTop,containerClientHeight:w.clientHeight,targetTop:sn(M,w),targetHeight:M.offsetHeight,padding:b.padding})}function lt(){const h=_.value;return h?Math.max(120,Math.round(h.clientHeight*.2)):120}function bt(h){const b=_.value,w=d.value[h];return!b||!w?null:sn(w,b)-b.scrollTop}function xt(h){const b=bt(h);return b===null?null:{mode:"preserve",anchorOffset:b}}function Ke(){const h=L.value;if(h<0)return;const b=_.value,w=d.value[h];if(!(!b||!w)){if(te.value==="preserve"&&C.value!==null){const M=sn(w,b),ee=M-b.scrollTop,pe=Number(C.value)||0;if(Math.abs(ee-pe)<=lt()){et(M-pe);return}}xe(h,{align:$.value||"nearest"})}}function ct(){L.value<0||De(()=>{var h,b;Ke(),N&&((h=window.cancelAnimationFrame)==null||h.call(window,N)),N=((b=window.requestAnimationFrame)==null?void 0:b.call(window,()=>{N=0,Ke()}))||0})}function qe(h,b={}){const w=Math.max(-1,Number(h)||-1);if(w<0){Xe();return}L.value=w,$.value=b.align==="end"?"end":"nearest",te.value=b.mode==="preserve"?"preserve":"visible",C.value=typeof b.anchorOffset=="number"?b.anchorOffset:null,St(b.duration),ct()}function Te(h){gt(),!(!h||typeof window>"u"||typeof window.ResizeObserver>"u")&&(Y=new window.ResizeObserver(()=>{L.value>=0&&ct()}),Y.observe(h))}function xe(h,b={}){const w=d.value[h];if(!w)return;const{align:M="nearest"}=b,ee=_.value;if(!ee){w.scrollIntoView({block:M==="end"?"end":"nearest",inline:"nearest"});return}const pe=u1({containerScrollTop:ee.scrollTop,containerClientHeight:ee.clientHeight,targetTop:sn(w,ee),targetHeight:w.offsetHeight,align:M});pe!==ee.scrollTop&&et(pe)}function y(h,b=null,w={}){const M=d.value[h];if(!M)return;const ee=b??M.value.length;try{M.focus({preventScroll:!0})}catch{M.focus()}M.setSelectionRange(ee,ee),xe(h,w),w.follow!==!1&&qe(h,{align:w.align,mode:w.followMode,anchorOffset:w.followAnchorOffset,duration:w.followDuration}),v.value[h]={start:ee,end:ee}}function be(h,b){D.value=Date.now();const w=i.value.map((M,ee)=>ee===h?{...M,content:b}:M);fe(w)}function ze(h,b=""){const w=i.value[h];if(!J(w))return!1;const M=String(b??"");if(M===w.content)return!1;const ee=[...i.value];return ee.splice(h,1,{...w,content:M}),fe(ee),!0}function We(){let h=!1;return d.value.forEach((b,w)=>{b&&(h=ze(w,b.value)||h)}),h}function wt(h=null){return typeof h=="number"?c.value===h:c.value>=0}function Ut(h){const b=i.value.map((w,M)=>{var ee;return M===h?{...w,meta:{...w.meta,collapsed:!((ee=w.meta)!=null&&ee.collapsed)}}:w});fe(b)}function dt(h){const b=i.value[h];if(!b||b.type!==Pe.IMPORTED_TEXT)return;const w=i.value.map((M,ee)=>ee===h?{type:Pe.TEXT,content:M.content,meta:{}}:M);fe(w),a.value=h,De(()=>y(h,0))}function Rt(h){const b=i.value[h];if((b==null?void 0:b.type)===Pe.TEXT&&i.value.length===1){fe([{...b,content:""}]),De(()=>y(0,0));return}const w=i.value.filter((M,ee)=>ee!==h);fe(w),De(()=>{var ee;const M=Math.max(0,Math.min(h,w.length-1));((ee=i.value[M])==null?void 0:ee.type)===Pe.TEXT&&y(M,0)})}function at(){fe([_e("")]),a.value=0,v.value={0:{start:0,end:0}},De(()=>y(0,0))}function R(h="",b=180){return String(h).replace(/\s+/g," ").trim().slice(0,b)}function V(h=""){const b=String(h),w=b?b.split(`
235
+ `).length:0,M=b.length;return o("blockEditor.stats",{lines:w,chars:M})}function se(h,b,w={}){const{focusAfterInserted:M=!1}=w,ee=M?xt(h):null,pe=[...i.value],I=pe[h],Z=v.value[h]||{start:I.content.length,end:I.content.length},G=Math.max(0,Z.start??0),Ue=Math.max(G,Z.end??G),je=I.content.slice(0,G),vt=I.content.slice(Ue),ut=[];je&&ut.push({...I,content:je}),ut.push(...b),vt&&ut.push(_e(vt)),pe.splice(h,1,...ut),fe(pe),De(()=>{const su=M?h+ut.length-(vt?1:0):h,Gt=i.value.findIndex((Qu,xu)=>xu>=su&&Qu.type===Pe.TEXT);Gt>=0&&(a.value=Gt,y(Gt,0,{align:"nearest",followMode:ee==null?void 0:ee.mode,followAnchorOffset:ee==null?void 0:ee.anchorOffset}))})}function he(h,b={}){const{focusAfterInserted:w=!1}=b;if(!h.length)return;const M=Math.min(a.value??0,Math.max(i.value.length-1,0)),ee=i.value[M],pe=w?xt(M):null;if(!ee||ee.type===Pe.IMPORTED_TEXT){const I=[...i.value],Z=M+1;I.splice(Z,0,...h),fe(I),w&&De(()=>{const G=i.value.findIndex((Ue,je)=>je>=Z+h.length&&Ue.type===Pe.TEXT);G>=0&&(a.value=G,y(G,0,{align:"nearest",followMode:pe==null?void 0:pe.mode,followAnchorOffset:pe==null?void 0:pe.anchorOffset}))});return}if(!W(ee)){const I=[...i.value],Z=I.length?M+1:0;I.splice(Z,0,...h),fe(I),w&&De(()=>{const G=i.value.findIndex((Ue,je)=>je>=Z+h.length&&Ue.type===Pe.TEXT);G>=0&&(a.value=G,y(G,0,{align:"nearest",followMode:pe==null?void 0:pe.mode,followAnchorOffset:pe==null?void 0:pe.anchorOffset}))});return}se(M,h,{focusAfterInserted:w})}function Ce(h){const b=String(h||"");if(!b)return;const w=Math.min(a.value??0,Math.max(i.value.length-1,0)),M=i.value[w];if(!M||!J(M)){he([_e(b)]);return}const ee=v.value[w]||{start:M.content.length,end:M.content.length},pe=Math.max(0,ee.start??0),I=Math.max(pe,ee.end??pe),Z=`${M.content.slice(0,pe)}${b}${M.content.slice(I)}`,G=[...i.value];G.splice(w,1,{...M,content:Z}),fe(G),De(()=>y(w,pe+b.length))}function Dt(h){he(h,{focusAfterInserted:!0})}function tu(h){he(h,{focusAfterInserted:!0})}function Mt(h){he(h,{focusAfterInserted:!0})}function Tt(h,b){const w=i.value[h],M=i.value[b];if(!J(w)||!J(M))return;const ee=b<h?`${M.content}${w.content}`:`${w.content}${M.content}`,pe=[...i.value],I=Math.min(h,b),Z=Math.max(h,b);pe.splice(I,1,{...pe[I],content:ee}),pe.splice(Z,1),fe(pe);const G=b<h?M.content.length:w.content.length;a.value=I,De(()=>y(I,G))}function uu(h,b,w=0){const M=i.value.filter((pe,I)=>I!==b);fe(M);const ee=b<h?h-1:h;a.value=ee,De(()=>y(ee,w))}function nu(h){const b=i.value.findIndex((w,M)=>M>h&&w.type===Pe.TEXT);b>=0&&(a.value=b,De(()=>y(b,0)))}function ou(h){const b=String(h||"").trim();b&&(x.value=b)}function ru(h){const b=[...h].filter(w=>w&&w.type.startsWith("image/"));b.length&&r("upload-files",b)}function k(h){if(!h)return!1;const b=String(h.name||"").toLowerCase(),w=String(h.type||"").toLowerCase();return b.endsWith(".md")||b.endsWith(".markdown")||b.endsWith(".txt")||w.startsWith("text/")}function S(h){if(!h)return!1;const b=String(h.name||"").toLowerCase(),w=String(h.type||"").toLowerCase();return b.endsWith(".pdf")||w==="application/pdf"}function z(h){const b=[...h].filter(Boolean);return{imageFiles:b.filter(w=>w.type.startsWith("image/")),textFiles:b.filter(w=>k(w)),pdfFiles:b.filter(w=>S(w))}}function re(h){const b=[...h.clipboardData.items].filter(w=>w.kind==="file").map(w=>w.getAsFile()).filter(Boolean);b.length&&(h.preventDefault(),ru(b))}function ne(h){h.preventDefault();const{imageFiles:b,textFiles:w,pdfFiles:M}=z(h.dataTransfer.files);w.length&&r("import-text-files",w),M.length&&r("import-pdf-files",M),b.length&&ru(b)}function ke(h){const{imageFiles:b,textFiles:w,pdfFiles:M}=z(h.target.files);w.length&&r("import-text-files",w),M.length&&r("import-pdf-files",M),b.length&&ru(b),h.target.value=""}function tt(){var h;(h=F.value)==null||h.click()}function Ae(h){var b;return!!((b=h==null?void 0:h.closest)!=null&&b.call(h,'textarea,button,input,select,option,label,a,[contenteditable="true"]'))}function jt(h=0){const b=d.value.map((M,ee)=>({element:M,index:ee})).filter(M=>M.element);if(!b.length)return-1;const w=b.reduce((M,ee)=>{const pe=ee.element.getBoundingClientRect(),I=pe.top+pe.height/2,Z=Math.abs(h-I);return!M||Z<M.distance?{index:ee.index,distance:Z}:M},null);return(w==null?void 0:w.index)??-1}function iu(){if(!Array.isArray(i.value)||!i.value.length)return-1;const h=Math.max(0,Math.min(a.value??0,i.value.length-1));if(d.value[h])return h;let b=-1,w=Number.POSITIVE_INFINITY;return d.value.forEach((M,ee)=>{if(!M)return;const pe=Math.abs(ee-h);(pe<w||pe===w&&ee>h)&&(b=ee,w=pe)}),b}function bu(h=0,b={}){const{preferActive:w=!1}=b,M=w?iu():jt(h);M<0||(ce(),a.value=M,De(()=>{var I,Z;const ee=d.value[M],pe=h<=(((I=ee==null?void 0:ee.getBoundingClientRect)==null?void 0:I.call(ee).top)??0)?0:((Z=ee==null?void 0:ee.value)==null?void 0:Z.length)||0;y(M,pe)}))}function Au(h){var b,w;Ae(h.target)||(w=(b=m.value)==null?void 0:b.contains)!=null&&w.call(b,h.target)&&bu(h.clientY||0,{preferActive:!0})}function pt(h,b){D.value=Date.now();const w=ue.value.open&&ue.value.blockIndex===h;Ye(b.target,w?{allowShrink:!1,preserveViewport:!1,preserveSelection:!1}:void 0),X(h,b.target),qe(h,{align:h===i.value.length-1?"end":"nearest"})}function Pt(h){c.value=h,f.value=h,D.value=Date.now()}function Je(h,b){D.value=Date.now(),ze(h,b.target.value),pt(h,b)}function Vt(h,b){D.value=Date.now(),ze(h,b.target.value),c.value=-1,pt(h,b)}function Zu(h){f.value=h,st(h,{padding:0})||xe(h,{align:"nearest"})}function Xu(h){f.value===h&&(f.value=-1),!wt(h)&&L.value===h&&Xe()}async function Yu(h,b){var I,Z,G,Ue,je,vt,ut,su,Gt,Qu,xu,Co;const w=i.value[h],M=b.target;if((b.metaKey||b.ctrlKey)&&b.shiftKey&&b.key==="Backspace"){b.preventDefault(),r("clear-request");return}if(!J(w))return;if((b.metaKey||b.ctrlKey)&&!b.shiftKey&&!b.altKey&&b.key.toLowerCase()==="k"&&K()){b.preventDefault();return}if(ue.value.open&&ue.value.blockIndex===h){if(b.key==="Escape"){b.preventDefault(),ye();return}if(b.key==="ArrowDown"&&(Z=(I=B.value)==null?void 0:I.moveActive)!=null&&Z.call(I,1)){b.preventDefault();return}if(b.key==="ArrowUp"&&(Ue=(G=B.value)==null?void 0:G.moveActive)!=null&&Ue.call(G,-1)){b.preventDefault();return}if(b.key==="ArrowRight"&&await((vt=(je=B.value)==null?void 0:je.expandActiveDirectory)==null?void 0:vt.call(je))){b.preventDefault();return}if(b.key==="ArrowLeft"&&(su=(ut=B.value)==null?void 0:ut.collapseActiveDirectory)!=null&&su.call(ut)){b.preventDefault();return}if(!b.altKey&&!b.metaKey&&!b.ctrlKey&&b.key==="Tab"&&(Qu=(Gt=B.value)==null?void 0:Gt.switchTab)!=null&&Qu.call(Gt,b.shiftKey?-1:1)){b.preventDefault();return}if(!b.shiftKey&&!b.altKey&&!b.metaKey&&!b.ctrlKey&&b.key==="Enter"&&(Co=(xu=B.value)==null?void 0:xu.confirmActive)!=null&&Co.call(xu)){b.preventDefault();return}}const ee=M.selectionStart??0,pe=M.selectionEnd??0;if(b.key==="Backspace"&&ee===0&&pe===0){const Iu=i.value[h-1];if(!Iu)return;if(b.preventDefault(),J(Iu)){Tt(h,h-1);return}uu(h,h-1,0);return}if(b.key==="Delete"&&ee===w.content.length&&pe===w.content.length){const Iu=i.value[h+1];if(!Iu)return;if(b.preventDefault(),J(Iu)){Tt(h,h+1);return}uu(h,h+1,w.content.length)}}function Ju(){const h=i.value.findIndex(b=>b.type===Pe.TEXT);h<0||(a.value=h,De(()=>{var M;const b=d.value[h],w=(b==null?void 0:b.selectionStart)??((M=b==null?void 0:b.value)==null?void 0:M.length)??0;y(h,w)}))}function Fn(){return c.value>=0||f.value>=0?!0:Date.now()-D.value<dp}const Du=le(()=>i.value.map((h,b)=>{var w;return`${b}:${h.type}:${(w=h.meta)!=null&&w.collapsed?"1":"0"}`}).join("|")),$n=le(()=>i.value.map((h,b)=>J(h)?`${b}:${h.type}:${h.content||""}`:`${b}:${h.type}`).join("|"));return Ee(Du,()=>{De(()=>{Be()})},{immediate:!0}),Ee(()=>n.modelValue,h=>{const b=Me(h);$e(b,h)||r("update:modelValue",b),c.value>=b.length&&(c.value=-1)},{immediate:!0,deep:!0}),Ee($n,()=>{De(()=>{Be()})},{immediate:!0}),Ee(Du,()=>{ue.value.open&&De(de)}),Ee(g,h=>{Te(h)},{immediate:!0}),ft(()=>{Xe(),gt()}),t({clearContent:at,flushPendingInput:We,focusEditor:Ju,insertBlocks:tu,insertImportedBlocks:Mt,insertTextAtSelection:Ce,insertUploadedBlocks:Dt,isComposing:wt,isEditing:Fn,isImportedBlockActive:()=>{var h;return((h=i.value[a.value])==null?void 0:h.type)===Pe.IMPORTED_TEXT},openFilePicker:tt}),(h,b)=>(E(),O("section",{ref_key:"surfaceRef",ref:m,class:"panel relative flex h-full min-h-0 flex-col overflow-hidden",onClick:Au,onDrop:ne,onDragover:b[1]||(b[1]=Ve(()=>{},["prevent"])),onPaste:re},[p("div",N1,[p("div",O1,[p("p",z1,[ie(l(Pi),{class:"h-4 w-4"}),p("span",null,A(l(o)("blockEditor.title")),1)]),p("div",q1,[Pu(h.$slots,"header-actions")])]),p("input",{ref_key:"fileInputRef",ref:F,class:"hidden",type:"file",accept:"image/*,.md,.markdown,.txt,.pdf,text/plain,text/markdown,application/pdf",multiple:"",onChange:ke},null,544)]),p("div",{ref_key:"contentRef",ref:_,class:"flex-1 overflow-y-auto px-5 py-5",onScroll:Le},[p("div",{ref_key:"contentBodyRef",ref:g,class:"flex flex-col gap-5"},[(E(!0),O(mt,null,Ft(i.value,(w,M)=>{var ee,pe,I,Z;return E(),O(mt,{key:String(w.id||w.clientId||`${w.type}-${M}`)},[w.type===l(Pe).TEXT?(E(),O("div",U1,[p("textarea",{ref_for:!0,ref:G=>Ze(G,M),rows:"1",value:w.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent p-0 pr-12 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:M===0?l(o)("blockEditor.placeholderFirst"):l(o)("blockEditor.placeholderNext"),onFocus:G=>{l(j)(M),Zu(M)},onBlur:G=>Xu(M),onInput:G=>{be(M,G.target.value),pt(M,G)},onCompositionstart:G=>Pt(M),onCompositionupdate:G=>Je(M,G),onCompositionend:G=>Vt(M,G),onKeydown:G=>Yu(M,G),onClick:G=>l(T)(M,G),onKeyup:G=>l(T)(M,G),onSelect:G=>l(T)(M,G)},null,40,j1),p("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-0 top-1 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:G=>Rt(M)},[ie(l(Nu),{class:"h-3.5 w-3.5"}),p("span",null,A(l(o)("blockEditor.delete")),1)],8,V1)])):w.type===l(Pe).IMPORTED_TEXT?(E(),O("div",H1,[p("div",W1,[p("div",K1,[p("p",G1,A(l(o)("blockEditor.importedFile")),1),p("p",Z1,A(((ee=w.meta)==null?void 0:ee.fileName)||l(o)("blockEditor.unnamedFile")),1),p("p",X1,A(V(w.content)),1)]),p("div",Y1,[p("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>Ut(M)},[ie(l(Lu),{class:Se(["h-3.5 w-3.5",(pe=w.meta)!=null&&pe.collapsed?"rotate-180":""])},null,8,["class"]),p("span",null,A((I=w.meta)!=null&&I.collapsed?l(o)("blockEditor.expand"):l(o)("blockEditor.collapse")),1)],8,J1),p("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>dt(M)},[ie(l(Jn),{class:"h-3.5 w-3.5"}),p("span",null,A(l(o)("blockEditor.convertToText")),1)],8,Q1),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-1.5 px-2 py-1 text-xs",onClick:G=>Rt(M)},[ie(l(Nu),{class:"h-3.5 w-3.5"}),p("span",null,A(l(o)("blockEditor.delete")),1)],8,ep)])]),(Z=w.meta)!=null&&Z.collapsed?(E(),O("div",tp,[Bu(A(R(w.content)||l(o)("blockEditor.emptyContent")),1),w.content.length>180?(E(),O("span",up,"...")):ve("",!0)])):(E(),O("textarea",{key:1,ref_for:!0,ref:G=>Ze(G,M),rows:"1",value:w.content,class:"w-full resize-none overflow-hidden border-0 bg-transparent px-4 py-4 text-[15px] leading-8 text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:l(o)("blockEditor.emptyImportPlaceholder"),onFocus:G=>{l(j)(M),Zu(M)},onBlur:G=>Xu(M),onInput:G=>{be(M,G.target.value),pt(M,G)},onCompositionstart:G=>Pt(M),onCompositionupdate:G=>Je(M,G),onCompositionend:G=>Vt(M,G),onKeydown:G=>Yu(M,G),onClick:G=>l(T)(M,G),onKeyup:G=>l(T)(M,G),onSelect:G=>l(T)(M,G)},null,40,np))])):(E(),O("figure",op,[p("button",{type:"button",class:"tool-button tool-button-danger-subtle absolute right-3 top-3 z-10 inline-flex items-center gap-1.5 px-2 py-1 text-xs opacity-0 transition group-hover:opacity-100 focus:opacity-100",onClick:G=>Rt(M)},[ie(l(Nu),{class:"h-3.5 w-3.5"}),p("span",null,A(l(o)("blockEditor.delete")),1)],8,rp),p("div",{class:"theme-inline-panel overflow-hidden rounded-sm border",onClick:G=>nu(M)},[p("div",sp,[ie(l(fo),{class:"h-4 w-4"}),p("span",null,A(l(o)("blockEditor.insertedImage")),1)]),p("div",ap,[p("button",{type:"button",class:"inline-flex cursor-zoom-in justify-center",onClick:Ve(G=>ou(w.content),["stop"])},[p("img",{src:w.content,alt:l(o)("blockEditor.insertedImageAlt"),class:"max-h-[380px] w-auto max-w-full object-contain"},null,8,cp)],8,lp)])],8,ip)]))],64)}),128))],512)],544),ie(Dr,{modelValue:x.value,"onUpdate:modelValue":b[0]||(b[0]=w=>x.value=w),images:U.value},null,8,["modelValue","images"]),ie(L1,{ref_key:"mentionPickerRef",ref:B,open:l(ue).open&&!!l(ae),"session-id":e.codexSessionId,query:l(ue).query,"anchor-rect":l(ae),onClose:l(ye),onSelect:l(me)},null,8,["open","session-id","query","anchor-rect","onClose","onSelect"])],544))}},pp=["disabled"],hp=["disabled"],mp=["disabled"],gp={__name:"WorkbenchEditorActions",props:{canAddTodo:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},todoCount:{type:Number,default:0}},emits:["add-todo","open-file-picker","clear-request","copy-request","manage-todo","send-request"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=le(()=>u.sendState==="sending"||u.sendState==="running");return(i,s)=>(E(),O(mt,null,[p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.uploading,onMousedown:s[0]||(s[0]=Ve(()=>{},["prevent"])),onClick:s[1]||(s[1]=a=>n("open-file-picker"))},[e.uploading?(E(),we(l(Ot),{key:0,class:"h-4 w-4 animate-spin"})):(E(),we(l(Oi),{key:1,class:"h-4 w-4"})),p("span",null,A(l(r)("editor.chooseFiles")),1)],40,pp),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[2]||(s[2]=Ve(()=>{},["prevent"])),onClick:s[3]||(s[3]=a=>n("clear-request"))},[ie(l(zi),{class:"h-4 w-4"}),p("span",null,A(l(r)("editor.clear")),1)],32),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:!e.canAddTodo,onMousedown:s[4]||(s[4]=Ve(()=>{},["prevent"])),onClick:s[5]||(s[5]=a=>n("add-todo"))},[ie(l(kr),{class:"h-4 w-4"}),p("span",null,A(l(r)("editor.todo")),1)],40,hp),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",onMousedown:s[6]||(s[6]=Ve(()=>{},["prevent"])),onClick:s[7]||(s[7]=a=>n("manage-todo"))},[ie(l(yr),{class:"h-4 w-4"}),p("span",null,A(e.todoCount>0?l(r)("editor.todoWithCount",{count:e.todoCount}):l(r)("editor.todo")),1)],32),p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-1.5 px-2 py-2 text-xs sm:w-auto sm:gap-2 sm:px-3",disabled:e.isCurrentTaskSending,onMousedown:s[8]||(s[8]=Ve(()=>{},["prevent"])),onClick:s[9]||(s[9]=a=>n("send-request"))},[o.value?(E(),we(l(Ot),{key:0,class:"h-4 w-4 animate-spin"})):(E(),we(l(Ri),{key:1,class:"h-4 w-4"})),p("span",null,A(l(r)("editor.send")),1)],40,mp)],64))}},bp={key:0,class:"panel theme-muted-text flex h-full items-center px-5 py-4 text-sm"},fr={__name:"WorkbenchInputPanel",props:{canAddTodo:{type:Boolean,default:!1},codexSessionId:{type:String,default:""},isCurrentTaskSending:{type:Boolean,default:!1},sendState:{type:String,default:"idle"},modelValue:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},todoCount:{type:Number,default:0},uploading:{type:Boolean,default:!1}},emits:["add-todo","update:modelValue","upload-files","import-text-files","import-pdf-files","clear-request","copy-request","manage-todo","send-request"],setup(e,{expose:t,emit:u}){const n=e,r=u,o=H(null),{t:i}=_t(),s=le({get:()=>n.modelValue,set:v=>r("update:modelValue",v)});function a(){var v,x;(x=(v=o.value)==null?void 0:v.openFilePicker)==null||x.call(v)}function d(){var v,x;(x=(v=o.value)==null?void 0:v.focusEditor)==null||x.call(v)}function c(){var v,x;return((x=(v=o.value)==null?void 0:v.flushPendingInput)==null?void 0:x.call(v))||!1}function f(v){var x,D;(D=(x=o.value)==null?void 0:x.insertBlocks)==null||D.call(x,v)}function m(v){var x,D;(D=(x=o.value)==null?void 0:x.insertImportedBlocks)==null||D.call(x,v)}function _(v){var x,D;(D=(x=o.value)==null?void 0:x.insertUploadedBlocks)==null||D.call(x,v)}function g(){var v,x;return((x=(v=o.value)==null?void 0:v.isImportedBlockActive)==null?void 0:x.call(v))||!1}function F(){var v,x;return((x=(v=o.value)==null?void 0:v.isComposing)==null?void 0:x.call(v))||!1}function B(){var v,x;return((x=(v=o.value)==null?void 0:v.isEditing)==null?void 0:x.call(v))||!1}return t({focusEditor:d,flushPendingInput:c,insertBlocks:f,insertImportedBlocks:m,insertUploadedBlocks:_,isComposing:F,isEditing:B,isImportedBlockActive:g,openFilePicker:a}),(v,x)=>e.loading&&!e.modelValue.length?(E(),O("section",bp,A(l(i)("workbench.loadingTaskContent")),1)):(E(),we(fp,{key:1,ref_key:"blockEditorRef",ref:o,modelValue:s.value,"onUpdate:modelValue":x[5]||(x[5]=D=>s.value=D),"codex-session-id":e.codexSessionId,uploading:e.uploading,onUploadFiles:x[6]||(x[6]=D=>r("upload-files",D)),onImportTextFiles:x[7]||(x[7]=D=>r("import-text-files",D)),onImportPdfFiles:x[8]||(x[8]=D=>r("import-pdf-files",D)),onClearRequest:x[9]||(x[9]=D=>r("clear-request"))},{"header-actions":Et(()=>[ie(gp,{"can-add-todo":e.canAddTodo,"is-current-task-sending":e.isCurrentTaskSending,"send-state":e.sendState,"todo-count":e.todoCount,uploading:e.uploading,onAddTodo:x[0]||(x[0]=D=>r("add-todo")),onOpenFilePicker:a,onClearRequest:x[1]||(x[1]=D=>r("clear-request")),onCopyRequest:x[2]||(x[2]=D=>r("copy-request")),onManageTodo:x[3]||(x[3]=D=>r("manage-todo")),onSendRequest:x[4]||(x[4]=D=>r("send-request"))},null,8,["can-add-todo","is-current-task-sending","send-state","todo-count","uploading"])]),_:1},8,["modelValue","codex-session-id","uploading"]))}},xp={class:"panel workbench-mobile-header-panel shrink-0 overflow-hidden"},vp={class:"workbench-panel-header workbench-mobile-header theme-divider border-b px-4 py-3"},yp={class:"flex items-center gap-3"},kp={class:"min-w-0 flex-1"},_p=["value","placeholder"],Sp=["disabled"],wp={class:"truncate"},Tp={__name:"WorkbenchMobileDetailHeader",props:{currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},title:{type:String,default:""},titleInputValue:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""}},emits:["back","begin-edit","title-blur","cancel-title-edit","update:titleInputValue"],setup(e,{emit:t}){const u=t,{t:n}=_t();return(r,o)=>(E(),O("section",xp,[p("div",vp,[p("div",yp,[p("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-1.5 px-3 py-2 text-xs",onClick:o[0]||(o[0]=i=>u("back"))},[ie(l(Ti),{class:"h-4 w-4"}),p("span",null,A(l(n)("workbench.tasks")),1)]),p("div",kp,[e.currentTaskSlug&&e.editingTaskTitleSlug===e.currentTaskSlug?(E(),O("input",{key:0,value:e.titleInputValue,type:"text",maxlength:"140","data-task-title-input":"current",class:"block w-full appearance-none border-0 bg-transparent p-0 text-left text-sm font-semibold leading-6 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||l(n)("workbench.untitledTask"),onInput:o[1]||(o[1]=i=>u("update:titleInputValue",i.target.value)),onKeydown:[o[2]||(o[2]=fu(Ve(i=>i.target.blur(),["prevent"]),["enter"])),o[3]||(o[3]=fu(Ve(i=>u("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:o[4]||(o[4]=i=>u("title-blur"))},null,40,_p)):(E(),O("button",{key:1,type:"button",class:"inline-flex w-full items-center gap-2 truncate bg-transparent p-0 text-left text-sm font-semibold leading-6",disabled:!e.currentTaskSlug,onClick:o[5]||(o[5]=i=>u("begin-edit"))},[p("span",wp,A(e.title||l(n)("workbench.untitledTask")),1),ie(l(Ou),{class:"h-3.5 w-3.5 shrink-0 opacity-50"})],8,Sp))])])])]))}},Cp={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},Ep={class:"flex items-center justify-between gap-3"},Ap={class:"flex min-h-8 items-center"},Dp={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Ip=["title"],Fp=["disabled","title"],$p={class:"whitespace-nowrap"},Mp={class:"min-h-0 flex-1 overflow-y-auto px-3 py-3"},Pp={key:0,class:"theme-empty-state px-3 py-4 text-sm"},Bp=["onClick"],Rp={key:0,class:"theme-selection-indicator absolute inset-y-2 left-0 w-1 rounded-full"},Lp={class:"flex items-start justify-between gap-3"},Np={class:"min-w-0 h-5 flex-1 overflow-hidden"},Op=["value","placeholder"],zp=["title","onClick"],qp={class:"min-w-0 truncate"},Up={class:"flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80"},jp={class:"theme-divider border-t px-3 py-3"},Vp={key:0,class:"theme-danger-text mb-3 inline-flex min-w-0 items-start gap-2 text-xs"},Hp={class:"min-w-0 break-words"},Wp={class:"grid grid-cols-2 gap-2"},Kp=["disabled","title"],Gp={class:"whitespace-nowrap"},Zp=["disabled","title"],Xp={class:"whitespace-nowrap"},pr={__name:"WorkbenchTaskListPanel",props:{loadingTasks:{type:Boolean,default:!1},tasks:{type:Array,default:()=>[]},currentTaskSlug:{type:String,default:""},editingTaskTitleSlug:{type:String,default:""},draftTitle:{type:String,default:""},currentTaskAutoTitle:{type:String,default:""},creatingTask:{type:Boolean,default:!1},loadingTask:{type:Boolean,default:!1},uploading:{type:Boolean,default:!1},error:{type:String,default:""},removingTask:{type:Boolean,default:!1},isCurrentTaskSending:{type:Boolean,default:!1},mobile:{type:Boolean,default:!1}},emits:["open-settings","create-task","select-task","title-click","title-blur","cancel-title-edit","update:draftTitle","edit-task","delete-task"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t();function o(c){return c.slug===u.currentTaskSlug?"workbench-task-card--active theme-card-selected":c.sending?"workbench-task-card--running theme-card-warning":"theme-card-idle-muted"}function i(){return"theme-status-warning"}function s(c){const f=new Date(c.updatedAt);return Number.isNaN(f.getTime())?"":u.mobile?gi(f.toISOString()):xr(f.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function a(c){var f,m;return!((f=c==null?void 0:c.workspaceDiffSummary)!=null&&f.supported)||!((m=c==null?void 0:c.workspaceDiffSummary)!=null&&m.fileCount)?!1:u.mobile?c.slug===u.currentTaskSlug||!!c.sending:!0}function d(c){return c.slug===u.currentTaskSlug?"theme-badge-strong":"theme-badge-muted"}return(c,f)=>(E(),O("aside",Cp,[p("div",{class:Se(["workbench-panel-header theme-divider border-b px-4 py-4",e.mobile?"workbench-mobile-header px-3 py-3":""])},[p("div",Ep,[p("div",Ap,[p("div",Dp,[ie(l(Ei),{class:"h-4 w-4"}),p("span",null,A(l(r)("workbench.title")),1)])]),p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 whitespace-nowrap px-3 py-2 text-xs",title:l(r)("workbench.settings"),onClick:f[0]||(f[0]=m=>n("open-settings"))},[ie(l(Li),{class:"h-4 w-4"}),p("span",{class:Se(e.mobile?"whitespace-nowrap":"hidden whitespace-nowrap sm:inline")},A(l(r)("workbench.settings")),3)],8,Ip)]),p("button",{type:"button",class:"tool-button tool-button-primary mt-4 inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:e.creatingTask||e.uploading,title:e.creatingTask?l(r)("workbench.creatingTask"):l(r)("workbench.createTask"),onClick:f[1]||(f[1]=m=>n("create-task"))},[ie(l(kr),{class:"h-4 w-4"}),p("span",$p,A(e.creatingTask?l(r)("workbench.creatingTask"):l(r)("workbench.createTask")),1)],8,Fp)],2),p("div",Mp,[e.loadingTasks&&!e.tasks.length?(E(),O("div",Pp,A(l(r)("workbench.loadingTasks")),1)):(E(),O("div",{key:1,class:Se(["space-y-2",e.mobile?"space-y-1.5":""])},[(E(!0),O(mt,null,Ft(e.tasks,m=>{var _,g;return E(),O("article",{key:m.slug,class:Se(["workbench-task-card group relative cursor-default rounded-sm border px-3 py-3 transition",[o(m),e.mobile?"workbench-task-card--mobile px-3 py-2.5":""]]),onClick:F=>n("select-task",m.slug)},[m.slug===e.currentTaskSlug?(E(),O("span",Rp)):ve("",!0),p("div",Lp,[p("div",Np,[m.slug===e.currentTaskSlug&&e.editingTaskTitleSlug===m.slug?(E(),O("input",{key:0,value:e.draftTitle,type:"text",maxlength:"140","data-task-title-input":"current",class:"block h-5 min-h-0 w-full appearance-none border-0 bg-transparent p-0 text-left text-sm font-semibold leading-5 outline-none placeholder:text-[var(--theme-textMuted)]",placeholder:e.currentTaskAutoTitle||l(r)("workbench.untitledTask"),onClick:f[2]||(f[2]=Ve(()=>{},["stop"])),onInput:f[3]||(f[3]=F=>n("update:draftTitle",F.target.value)),onKeydown:[f[4]||(f[4]=fu(Ve(F=>F.target.blur(),["prevent"]),["enter"])),f[5]||(f[5]=fu(Ve(F=>n("cancel-title-edit"),["prevent"]),["esc"]))],onBlur:f[6]||(f[6]=F=>n("title-blur"))},null,40,Op)):(E(),O("button",{key:1,type:"button",class:Se(["inline-flex h-5 w-full items-center gap-1.5 truncate bg-transparent p-0 text-left text-sm leading-5",m.slug===e.currentTaskSlug?"font-semibold":"font-medium"]),title:m.displayTitle,onClick:Ve(F=>n("title-click",m.slug),["stop"])},[(_=m.automation)!=null&&_.enabled?(E(),we(l(bn),{key:0,class:"h-3.5 w-3.5 shrink-0 opacity-70"})):ve("",!0),p("span",qp,A(m.displayTitle),1)],10,zp))]),p("div",Up,[m.sending?(E(),O("span",{key:0,class:Se(["inline-flex items-center gap-1.5 rounded-sm border border-dashed px-1.5 py-0.5",[i(),e.mobile?"text-[9px] tracking-[0.14em]":""]])},[f[9]||(f[9]=p("span",{class:"task-loading-dots","aria-hidden":"true"},[p("span",{class:"task-loading-dots__dot"}),p("span",{class:"task-loading-dots__dot"}),p("span",{class:"task-loading-dots__dot"})],-1)),p("span",null,A(l(r)("workbench.running")),1)],2)):ve("",!0)])]),p("div",{class:Se(["workbench-task-card__preview mt-2 truncate text-xs opacity-80",e.mobile?"mt-1.5 text-[11px]":""])},A(m.lastPromptPreview||l(r)("workbench.noMessagesYet")),3),p("div",{class:Se(["mt-2 flex items-center justify-between gap-3",e.mobile?"mt-1.5":""])},[p("div",{class:Se(["min-w-0 text-[11px] opacity-70",e.mobile?"text-[10px] opacity-60":""])},A(s(m)),3),p("div",{class:Se(["flex shrink-0 items-center gap-1.5 text-[10px] uppercase tracking-[0.18em] opacity-80",e.mobile?"tracking-[0.12em]":""])},[a(m)?(E(),O("span",{key:0,class:Se(["inline-flex items-center gap-1 rounded-sm border border-dashed px-1.5 py-0.5",[d(m),e.mobile?"text-[9px]":""]])},[p("span",null,A(l(r)("workbench.filesCount",{count:((g=m.workspaceDiffSummary)==null?void 0:g.fileCount)||0})),1)],2)):ve("",!0)],2)],2)],10,Bp)}),128))],2))]),p("div",jp,[e.error?(E(),O("div",Vp,[ie(l(vr),{class:"mt-0.5 h-4 w-4 shrink-0"}),p("span",Hp,A(e.error),1)])):ve("",!0),p("div",Wp,[p("button",{type:"button",class:"tool-button inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask,title:l(r)("workbench.editTask"),onClick:f[7]||(f[7]=m=>n("edit-task"))},[ie(l(Ou),{class:"h-4 w-4"}),p("span",Gp,A(l(r)("workbench.editTask")),1)],8,Kp),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex w-full items-center justify-center gap-2 whitespace-nowrap px-3 py-2 text-sm",disabled:!e.currentTaskSlug||e.removingTask||e.creatingTask||e.isCurrentTaskSending,title:e.removingTask?l(r)("workbench.deletingTask"):l(r)("workbench.deleteTask"),onClick:f[8]||(f[8]=m=>n("delete-task"))},[ie(l(Nu),{class:"h-4 w-4"}),p("span",Xp,A(e.removingTask?l(r)("workbench.deletingTask"):l(r)("workbench.deleteTask")),1)],8,Zp)])])]))}},Yp={class:"panel flex h-full w-full max-w-3xl flex-col overflow-hidden sm:h-[40rem] sm:max-h-[86vh]"},Jp={class:"theme-divider flex items-start justify-between gap-4 border-b px-5 py-4"},Qp={class:"min-w-0"},eh={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},th={class:"theme-muted-text mt-1 text-xs leading-5"},uh={class:"theme-divider flex items-center justify-between gap-3 border-b border-dashed px-5 py-3 text-xs"},nh={class:"theme-muted-text"},oh={class:"theme-status-neutral inline-flex items-center rounded-sm border border-dashed px-2 py-1"},rh={key:0,class:"min-h-0 flex-1 overflow-y-auto px-5 py-4"},ih={class:"space-y-3"},sh={class:"flex flex-wrap items-start justify-between gap-3"},ah={class:"min-w-0 flex-1"},lh={class:"theme-heading flex flex-wrap items-center gap-2 text-sm font-medium"},ch={class:"theme-status-neutral inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-0.5 text-[11px]"},dh={class:"mt-2 whitespace-pre-wrap break-words text-sm leading-6"},fh={class:"theme-muted-text mt-3 flex flex-wrap items-center gap-2 text-[11px]"},ph={class:"rounded-sm border border-dashed px-2 py-1"},hh={key:0,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},mh={key:1,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},gh={key:2,class:"inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1"},bh={class:"flex shrink-0 items-center gap-2"},xh=["onClick"],vh=["onClick"],yh={key:1,class:"theme-empty-state flex min-h-0 flex-1 items-center justify-center px-6 py-10 text-sm"},kh={__name:"WorkbenchTodoDialog",props:{items:{type:Array,default:()=>[]},open:{type:Boolean,default:!1}},emits:["close","delete","use"],setup(e,{emit:t}){const u=e,n=t,{t:r}=_t(),o=le(()=>(u.items||[]).map(a=>{var F;const d=Array.isArray(a==null?void 0:a.blocks)?a.blocks:[],c=((F=d.find(B=>["text","imported_text"].includes(String((B==null?void 0:B.type)||""))&&String((B==null?void 0:B.content)||"").trim()))==null?void 0:F.content)||"",f=String(c||"").replace(/\s+/g," ").trim().slice(0,120),m=d.filter(B=>String((B==null?void 0:B.type)||"")==="image").length,_=d.filter(B=>String((B==null?void 0:B.type)||"")==="imported_text").length,g=d.filter(B=>String((B==null?void 0:B.type)||"")==="text"&&String((B==null?void 0:B.content)||"").trim()).length;return{...a,blockCount:d.length,imageCount:m,importedCount:_,preview:f||(m?r("todoDialog.imagePreview",{count:m}):r("todoDialog.noPreview")),textCount:g,timeLabel:i(a==null?void 0:a.createdAt)}}));function i(a=""){const d=Date.parse(String(a||""));if(!d)return r("todoDialog.justAdded");try{return new Intl.DateTimeFormat(void 0,{month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(d))}catch{return String(a||"")}}function s(a){u.open&&a.key==="Escape"&&n("close")}return Ee(()=>u.open,a=>{if(document.body.classList.toggle("overflow-hidden",a),a){window.addEventListener("keydown",s);return}window.removeEventListener("keydown",s)},{immediate:!0}),ft(()=>{document.body.classList.remove("overflow-hidden"),window.removeEventListener("keydown",s)}),(a,d)=>(E(),we(hu,{to:"body"},[e.open?(E(),O("div",{key:0,class:"theme-modal-backdrop fixed inset-0 z-[70] flex items-center justify-center px-4 py-6",onClick:d[1]||(d[1]=Ve(c=>n("close"),["self"]))},[p("section",Yp,[p("div",Jp,[p("div",Qp,[p("div",eh,[ie(l(yr),{class:"h-4 w-4"}),p("span",null,A(l(r)("todoDialog.title")),1)]),p("p",th,A(l(r)("todoDialog.intro")),1)]),p("button",{type:"button",class:"theme-icon-button h-8 w-8 shrink-0",onClick:d[0]||(d[0]=c=>n("close"))},[ie(l(Cn),{class:"h-4 w-4"})])]),p("div",uh,[p("span",nh,A(l(r)("todoDialog.summary",{count:o.value.length})),1),p("span",oh,A(l(r)("todoDialog.summaryHint")),1)]),o.value.length?(E(),O("div",rh,[p("div",ih,[(E(!0),O(mt,null,Ft(o.value,c=>(E(),O("article",{key:c.id,class:"theme-card-idle-muted rounded-sm border border-dashed p-4"},[p("div",sh,[p("div",ah,[p("div",lh,[p("span",null,A(l(r)("todoDialog.itemTitle")),1),p("span",ch,[ie(l(bn),{class:"h-3.5 w-3.5"}),Bu(" "+A(c.timeLabel),1)])]),p("p",dh,A(c.preview),1),p("div",fh,[p("span",ph,A(l(r)("todoDialog.blockCount",{count:c.blockCount})),1),c.textCount?(E(),O("span",hh,[ie(l(Jn),{class:"h-3.5 w-3.5"}),Bu(" "+A(l(r)("todoDialog.textCount",{count:c.textCount})),1)])):ve("",!0),c.importedCount?(E(),O("span",mh,[ie(l(Jn),{class:"h-3.5 w-3.5"}),Bu(" "+A(l(r)("todoDialog.importedCount",{count:c.importedCount})),1)])):ve("",!0),c.imageCount?(E(),O("span",gh,[ie(l(fo),{class:"h-3.5 w-3.5"}),Bu(" "+A(l(r)("todoDialog.imageCount",{count:c.imageCount})),1)])):ve("",!0)])]),p("div",bh,[p("button",{type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:f=>n("use",c.id)},[ie(l(Ci),{class:"h-4 w-4"}),p("span",null,A(l(r)("todoDialog.use")),1)],8,xh),p("button",{type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",onClick:f=>n("delete",c.id)},[ie(l(Nu),{class:"h-4 w-4"}),p("span",null,A(l(r)("todoDialog.delete")),1)],8,vh)])])]))),128))])])):(E(),O("div",yh,A(l(r)("todoDialog.empty")),1))])])):ve("",!0)]))}},_h={class:"pointer-events-none fixed inset-x-0 top-4 z-40 flex justify-center px-4"},Sh={key:0,class:"app-top-toast theme-status-success flex max-w-md items-center gap-2 rounded-sm border px-4 py-2 text-sm shadow-[var(--theme-shadowPanel)] backdrop-blur"},wh={__name:"TopToast",props:{message:{type:String,default:""}},setup(e){return(t,u)=>(E(),we(hu,{to:"body"},[p("div",_h,[ie(bi,{"enter-active-class":"transform transition duration-200 ease-out","enter-from-class":"-translate-y-3 opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transform transition duration-150 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"-translate-y-2 opacity-0"},{default:Et(()=>[e.message?(E(),O("div",Sh,[ie(l(Fi),{class:"h-4 w-4 shrink-0"}),p("span",null,A(e.message),1)])):ve("",!0)]),_:1})])]))}};function Th(e,t=!1){const u=H(!!t);let n=null,r=()=>{};function o(i){u.value=!!i}return mu(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;n=window.matchMedia(e),o(n.matches);const i=s=>{o(s.matches)};if(typeof n.addEventListener=="function"){n.addEventListener("change",i),r=()=>n==null?void 0:n.removeEventListener("change",i);return}typeof n.addListener=="function"&&(n.addListener(i),r=()=>n==null?void 0:n.removeListener(i))}),ft(()=>{r()}),{matches:u}}const Ch="(max-width: 1023px)",mn="promptxWorkbenchMobileView";function Gn(e){return(e==null?void 0:e[mn])==="detail"}function Eh({currentTaskSlug:e}){const{matches:t}=Th(Ch),u=H("tasks"),n=H("activity");function r(f="tasks"){if(typeof window>"u")return;const m={...window.history.state||{}};f==="detail"?m[mn]="detail":delete m[mn],window.history.replaceState(m,"")}function o(){if(typeof window>"u")return;const f={...window.history.state||{},[mn]:"detail"};window.history.pushState(f,"")}function i(f=null){if(!t.value){u.value="detail";return}if(!e.value){u.value="tasks",r("tasks");return}u.value=Gn(f)?"detail":"tasks"}function s(f){t.value=!!f,i(typeof window>"u"?null:window.history.state)}function a(f={}){const{pushHistory:m=!0}=f;if(u.value="detail",!!t.value){if(m){o();return}r("detail")}}function d(f={}){const{useHistory:m=!0}=f;if(!t.value){u.value="tasks";return}if(m&&typeof window<"u"&&Gn(window.history.state)){window.history.back();return}u.value="tasks",r("tasks")}function c(f){t.value&&(u.value=Gn(f.state)&&e.value?"detail":"tasks")}return mu(()=>{typeof window>"u"||window.addEventListener("popstate",c)}),ft(()=>{typeof window<"u"&&window.removeEventListener("popstate",c)}),Ee(t,f=>{s(f)},{immediate:!0}),Ee(e,()=>{typeof window>"u"||i(window.history.state)},{flush:"post"}),{enterMobileDetail:a,isMobileLayout:t,leaveMobileDetail:d,mobileDetailTab:n,mobileView:u}}const ao="PromptX";function Ah(e=""){const t=String(l(e)||"").trim();return t?`${ao} (${t})`:ao}function Dh(e=""){xi(()=>{typeof document>"u"||(document.title=Ah(e))}),ft(()=>{typeof document>"u"||(document.title=ao)})}function Ih(e=2200){const t=H("");let u=null;function n(){u&&(window.clearTimeout(u),u=null),t.value=""}function r(o,i=e){t.value=o,u&&window.clearTimeout(u),u=window.setTimeout(()=>{t.value="",u=null},i)}return ft(()=>{u&&window.clearTimeout(u)}),{toastMessage:t,flashToast:r,clearToast:n}}function Fh(e="",t=""){const u=String(e||"").trim();if(!u)return"";if(/^https?:\/\//i.test(u))return u;try{return new URL(u,t).toString()}catch{return u}}function $h(e,t){const u=[];for(const[n,r]of((e==null?void 0:e.blocks)||[]).entries()){if(r.type===Pe.TEXT||r.type===Pe.IMPORTED_TEXT){const o=String(r.content||"").trim();o&&u.push(o,"");continue}if(r.type===Pe.IMAGE){const o=Fh(r.content,t);o&&u.push(o,"")}}return u.join(`
236
+ `).trim()}function Mh(e,t){return $h(e,t)}const lo="promptx:active-task-slug",Ph=150;function _n(e=null){return!e||typeof e!="object"?null:{supported:!!e.supported,fileCount:Math.max(0,Number(e.fileCount)||0),additions:Math.max(0,Number(e.additions)||0),deletions:Math.max(0,Number(e.deletions)||0),statsComplete:!!e.statsComplete}}function Qt(e=[]){return(e||[]).map(t=>{var u,n;return{...t,clientId:String((t==null?void 0:t.clientId)||(t==null?void 0:t.id)||((n=(u=globalThis.crypto)==null?void 0:u.randomUUID)==null?void 0:n.call(u))||`block-${Date.now()}-${Math.random().toString(36).slice(2,8)}`),meta:t!=null&&t.meta?{...t.meta}:{}}})}function yt(e=[]){return(e||[]).map(t=>({id:String((t==null?void 0:t.id)||"").trim(),createdAt:String((t==null?void 0:t.createdAt)||""),blocks:Qt((t==null?void 0:t.blocks)||[])}))}function hr(e={}){return{title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),blocks:Qt(e.blocks||[]),todoItems:yt(e.todoItems||[])}}function hi(e=[]){return Qt(e).filter(t=>(t==null?void 0:t.type)===Pe.IMAGE?!!String(t.content||"").trim():!!String((t==null?void 0:t.content)||"").trim())}function Bh(e=[]){return hi(e).length>0}function Rh(){var t,u;const e=(u=(t=globalThis.crypto)==null?void 0:t.randomUUID)==null?void 0:u.call(t);return e?`todo-${e}`:`todo-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function mr(){return Qt([{type:Pe.TEXT,content:"",meta:{}}])}function co(e=[],t=16){return is(e,t)||""}function Lh(e=[],t=120){const u=e.find(n=>((n==null?void 0:n.type)==="text"||(n==null?void 0:n.type)==="imported_text")&&String(n.content||"").trim());return String((u==null?void 0:u.content)||"").replace(/\s+/g," ").trim().slice(0,t)}function gr(e={},t=[]){const u=String((e==null?void 0:e.title)||"").trim();if(u)return u;const n=String((e==null?void 0:e.autoTitle)||"").trim();if(n)return n;const r=co(t);if(r)return r;const o=String((e==null?void 0:e.preview)||"").trim();return o?o.slice(0,16):Re("workbench.untitledTask")}function Sn(e={}){return!!(e!=null&&e.running)}function Nh(e={},t=!1){return t&&!Sn(e)?"sending":Sn(e)?"running":"idle"}function Oh(e=""){return["queued","starting","running","stopping"].includes(String(e||"").trim())}function br(e="",t=72){return String(e||"").replace(/\s+/g," ").trim().slice(0,t)}function zh(e=[],t=[]){const u=new Map((e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),n=(t||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim(),d=String((s==null?void 0:s.codexSessionId)||"").trim();if(!a)return s;if(Object.prototype.hasOwnProperty.call(s,"workspaceDiffSummary"))return{...s,workspaceDiffSummary:_n(s.workspaceDiffSummary)};if(!d)return{...s,workspaceDiffSummary:null};const c=u.get(a),f=String((c==null?void 0:c.codexSessionId)||"").trim();return f&&f===d?{...s,workspaceDiffSummary:_n(c.workspaceDiffSummary)}:{...s,workspaceDiffSummary:null}}),r=new Map(n.map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a?[a,s]:null}).filter(Boolean)),o=(e||[]).map(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&r.get(a)||null}).filter(Boolean);return[...n.filter(s=>{const a=String((s==null?void 0:s.slug)||"").trim();return a&&!u.has(a)}),...o]}function qh(e=[],t=[]){const u=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return!1;if(u.length!==n.length)return!0;const r=new Map(u.map(o=>{const i=String((o==null?void 0:o.slug)||"").trim();return i?[i,o]:null}).filter(Boolean));return n.some(o=>{const i=String((o==null?void 0:o.slug)||"").trim();if(!i)return!0;const s=r.get(i);if(!s)return!0;const a=String((o==null?void 0:o.codexSessionId)||"").trim(),d=String((s==null?void 0:s.codexSessionId)||"").trim();return!!(a!==d||!!(o!=null&&o.running)!=!!(s!=null&&s.running)||a&&!Object.prototype.hasOwnProperty.call(s||{},"workspaceDiffSummary")||a&&(s==null?void 0:s.workspaceDiffSummary)==null)})}function an(e){if(typeof window>"u")return;const t=String(e||"").trim();if(t){window.localStorage.setItem(lo,t);return}window.localStorage.removeItem(lo)}function Uh(){return typeof window>"u"?"":String(window.localStorage.getItem(lo)||"").trim()}function jh(){if(typeof window>"u")return"";try{const e=new URL(window.location.href);return String(e.searchParams.get("task")||"").trim()}catch{return""}}function Vh(){if(!(typeof window>"u"))try{const e=new URL(window.location.href);if(!e.searchParams.has("task"))return;e.searchParams.delete("task");const t=`${e.pathname}${e.search}${e.hash}`;window.history.replaceState({},"",t||"/")}catch{}}function Mu(e){const t={slug:e.slug,title:String(e.title||""),autoTitle:String(e.autoTitle||""),lastPromptPreview:String(e.lastPromptPreview||""),codexSessionId:String(e.codexSessionId||""),codexRunCount:Math.max(0,Number(e.codexRunCount)||0),todoCount:Math.max(0,Number(e.todoCount)||0),running:!!e.running,preview:String(e.lastPromptPreview||""),updatedAt:e.updatedAt||e.createdAt||new Date().toISOString(),createdAt:e.createdAt||e.updatedAt||new Date().toISOString(),automation:e!=null&&e.automation?{enabled:!!e.automation.enabled,cron:String(e.automation.cron||""),nextTriggerAt:String(e.automation.nextTriggerAt||"")}:void 0,notification:e!=null&&e.notification?{enabled:!!e.notification.enabled,channelType:String(e.notification.channelType||""),triggerOn:String(e.notification.triggerOn||""),lastStatus:String(e.notification.lastStatus||""),lastSentAt:String(e.notification.lastSentAt||"")}:void 0};return Object.prototype.hasOwnProperty.call(e,"workspaceDiffSummary")&&(t.workspaceDiffSummary=_n(e.workspaceDiffSummary)),t}function Hh(e={}){const{clearToast:t=()=>{},flashToast:u=()=>{},scrollCurrentPanelToBottom:n=()=>{}}=e,r=mo(),o=Br(),i=H(null),s=H([]),a=H({}),d=H({}),c=H({}),f=H(""),m=H({title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]}),_=H(!0),g=H(!1),F=H(!1),B=H(!1),v=H(!1),x=H(!1),D=H(""),L=H(!1),$=H("");let te=null,C=null,Q=0,Y=null,N=0,q=null,ue={};const ae=le(()=>co(m.value.blocks)),me=le(()=>gr({title:m.value.title,autoTitle:m.value.autoTitle,preview:Lh(m.value.blocks)},m.value.blocks)),ce=le(()=>d.value[f.value]||""),ye=le(()=>Nh(Me(f.value),c.value[f.value])),j=le(()=>ye.value!=="idle"),K=le(()=>s.value.some(k=>Sn(k))||Object.values(c.value).some(Boolean)),T=le(()=>Bh(m.value.blocks)),X=le(()=>yt(m.value.todoItems)),de=le(()=>me.value||Re("workbench.untitledTask")),U=le(()=>s.value.map(k=>Ye(k)));function W(k=""){return!k||!k.startsWith(r)?k:k.slice(r.length)}function J(k=[]){return k.map(S=>({id:Number.isInteger(Number(S==null?void 0:S.id))?Number(S.id):null,type:S==null?void 0:S.type,content:(S==null?void 0:S.type)==="image"?W(S.content):S.content,meta:S!=null&&S.meta?{...S.meta}:{}}))}function ge(k=[]){return(k||[]).map(S=>({id:String((S==null?void 0:S.id)||"").trim(),createdAt:String((S==null?void 0:S.createdAt)||""),blocks:J((S==null?void 0:S.blocks)||[])}))}function oe(k=m.value.title,S=m.value.autoTitle,z=m.value.lastPromptPreview,re=m.value.todoItems,ne=m.value.codexSessionId,ke=m.value.blocks){return JSON.stringify({title:String(k||""),autoTitle:String(S||""),lastPromptPreview:String(z||""),todoItems:ge(re),codexSessionId:String(ne||""),blocks:J(ke)})}function Ie(){return oe()!==$.value}function _e(){var k,S;return!!((S=(k=i.value)==null?void 0:k.isEditing)!=null&&S.call(k))}function Me(k){return s.value.find(S=>S.slug===k)||null}function $e(k){return k&&a.value[k]||null}function fe(k,S=""){const z=String(k||"").trim();z&&(ue={...ue,[z]:String(S||"").trim()})}function Ze(k=""){var ne;const S=String(k||"").trim();if(!S)return!1;const z=String(((ne=Me(S))==null?void 0:ne.updatedAt)||"").trim(),re=String(ue[S]||"").trim();return!!(z&&re&&z===re)}function Ye(k){const S=$e(k.slug),z=k.slug===f.value?m.value.blocks:(S==null?void 0:S.blocks)||[],re=k.slug===f.value?m.value.title:(S==null?void 0:S.title)??k.title,ne=k.slug===f.value?m.value.autoTitle:(S==null?void 0:S.autoTitle)??k.autoTitle,ke=k.slug===f.value?yt(m.value.todoItems).length:yt((S==null?void 0:S.todoItems)||[]).length||Number(k.todoCount||0),tt=k.slug===f.value?m.value.lastPromptPreview||k.lastPromptPreview||"":(S==null?void 0:S.lastPromptPreview)||k.lastPromptPreview||"",Ae=k.slug===f.value?d.value[k.slug]||m.value.codexSessionId||k.codexSessionId||"":(S==null?void 0:S.codexSessionId)||k.codexSessionId||"";return{...k,title:re,autoTitle:ne,todoCount:ke,preview:tt,codexSessionId:Ae,sessionSelectionLocked:!!(Ae&&Number(k.codexRunCount||0)>0),sessionSelectionLockReason:Ae&&Number(k.codexRunCount||0)>0?Re("taskActions.sessionLocked"):"",displayTitle:gr({title:re,autoTitle:ne,preview:tt},z),sending:Sn(k)}}function Be(k,S={}){const{insertAtStart:z=!1}=S;if(!(k!=null&&k.slug))return;const re=[...s.value],ne=re.findIndex(ke=>ke.slug===k.slug);if(ne>=0){re.splice(ne,1,{...re[ne],...k}),s.value=re;return}z?re.unshift(k):re.push(k),s.value=re}function Le(k,S){k&&(a.value={...a.value,[k]:hr(S)})}function it(k){return k?`${r}/api/tasks/${k}/raw`:`${r}/api/tasks/`}function Xe(k=""){const S=String(k||"").trim();if(!S)return;const z=Me(S),re=o.getTaskRunChange(S);if(!z||!(re!=null&&re.status))return;const ne=Oh(re.status);!!z.running!==ne&&Be({...z,running:ne})}function St(k,S){c.value={...c.value,[k]:!!S}}function gt(k=s.value){const S={};(k||[]).forEach(z=>{z!=null&&z.slug&&(S[z.slug]=!!z.running)}),c.value=S}function et(k,S){k&&(d.value={...d.value,[k]:String(S||"").trim()})}async function st(k,S){const z=String(k||"").trim();if(!z)return;const re=String(S||"").trim(),ne=Me(z),ke=d.value[z]||(ne==null?void 0:ne.codexSessionId)||"";if(!!(ke&&Number((ne==null?void 0:ne.codexRunCount)||0)>0)&&re!==ke){D.value=Re("taskActions.sessionLocked");return}et(z,re);const Ae=$e(z);Ae&&Le(z,{...Ae,codexSessionId:re}),ne&&Be({...ne,codexSessionId:re,workspaceDiffSummary:re&&re===ke?ne.workspaceDiffSummary:null}),z===f.value&&(m.value={...m.value,codexSessionId:re});try{await Bs(z,re)}catch(jt){et(z,ke),Ae&&Le(z,{...Ae,codexSessionId:ke}),ne&&Be({...ne,codexSessionId:ke}),z===f.value&&(m.value={...m.value,codexSessionId:ke}),D.value=jt.message}}function lt(){te&&(window.clearTimeout(te),te=null)}function bt(){Y&&(window.clearTimeout(Y),Y=null)}function xt(){lt(),!(g.value||!f.value)&&(te=window.setTimeout(()=>{wt({auto:!0,silent:!0})},1500))}function Ke(){if(!f.value)return;const k=Me(f.value)||{slug:f.value,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};Be({...k,title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoCount:yt(m.value.todoItems).length,codexSessionId:String(d.value[f.value]||m.value.codexSessionId||""),preview:String(m.value.lastPromptPreview||"")})}function ct(k={}){const S=String((k==null?void 0:k.slug)||"").trim();if(!S)return;const z=Mu(k);Be(z),fe(S,z.updatedAt||k.updatedAt||""),S===f.value&&(Object.prototype.hasOwnProperty.call(k,"title")&&(m.value.title=String(k.title||"")),Object.prototype.hasOwnProperty.call(k,"autoTitle")&&(m.value.autoTitle=String(k.autoTitle||"")),Le(S,{...m.value}))}function qe(k=[]){const S=new Map((k||[]).map(z=>{const re=String((z==null?void 0:z.slug)||"").trim();return re?[re,_n(z.workspaceDiffSummary)]:null}).filter(Boolean));S.size&&(s.value=s.value.map(z=>S.has(z.slug)?{...z,workspaceDiffSummary:S.get(z.slug)}:z))}async function Te(k=s.value){const S=Array.isArray(k)?k:[],z=S.filter(ne=>String((ne==null?void 0:ne.codexSessionId)||"").trim()),re=++N;if(!z.length){s.value=S.map(ne=>Object.prototype.hasOwnProperty.call(ne,"workspaceDiffSummary")?ne:{...ne,workspaceDiffSummary:null});return}try{const ne=await Ss(S.length||30);if(re!==N)return;qe(ne.items||[])}catch{}}async function xe(k={}){const{silent:S=!1}=k;S||(_.value=!0,D.value="");try{const z=s.value,re=await _s(),ne=zh(z,(re.items||[]).map(Mu));s.value=ne,gt(ne),qh(z,ne)&&Te(ne)}catch(z){S||(D.value=z.message)}finally{S||(_.value=!1)}}async function y(k=""){const S=String(f.value||"").trim(),z=String(k||"").trim();if(!S)return;if(!s.value.some(ne=>ne.slug===S)){if(s.value.length){await We(s.value[0].slug,{force:!0,skipIfDirtyOnApply:!0});return}f.value="",an(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=oe("","","",[],"",[]),L.value=!1;return}z&&z!==S||z&&(_e()||Ie()||L.value||v.value||x.value||g.value||await We(S,{force:!0,skipIfDirtyOnApply:!0,skipIfEditingOnApply:!0}))}function be(k=""){const S=String(k||"").trim();q===null?q=S:q!==S&&(q=""),!Y&&(Y=window.setTimeout(async()=>{const z=q;q=null,Y=null,await xe({silent:!0}),await y(z||"")},Ph))}async function ze(k){const S=await Cr(k),z=(S.blocks||[]).map(ne=>({...ne,content:ne.type==="image"?dn(ne.content):ne.content}));return{state:{title:String(S.title||""),autoTitle:String(S.autoTitle||""),lastPromptPreview:String(S.lastPromptPreview||""),codexSessionId:String(S.codexSessionId||""),blocks:z,todoItems:yt(S.todoItems||[])},summary:Mu({...S,blocks:z}),updatedAt:String(S.updatedAt||"")}}async function We(k,S={}){const{focusEditor:z=!1,force:re=!1,skipIfDirtyOnApply:ne=!1,skipIfEditingOnApply:ke=!1,scrollPanelToBottom:tt=!1}=S,Ae=String(k||"").trim();if(!Ae)return!1;const jt=++Q;g.value=!0,D.value="",t();try{const iu=String(f.value||"").trim(),bu=$e(Ae),Au=re&&bu&&Ze(Ae);let pt=re&&!Au?null:bu,Pt=null;if(!pt){const Je=await ze(Ae);pt=(Je==null?void 0:Je.state)||null,Pt=(Je==null?void 0:Je.summary)||null,fe(Ae,(Je==null?void 0:Je.updatedAt)||(Pt==null?void 0:Pt.updatedAt)||"")}return jt!==Q||ne&&Ae===f.value&&(Ie()||L.value)||ke&&Ae===f.value&&_e()?!1:(f.value=Ae,an(Ae),m.value=hr(pt),Le(Ae,pt),Pt&&Be(Pt),et(Ae,pt.codexSessionId),$.value=oe(m.value.title,m.value.autoTitle,m.value.lastPromptPreview,m.value.todoItems,m.value.codexSessionId,m.value.blocks),L.value=!1,z&&De(()=>{var Je,Vt;return(Vt=(Je=i.value)==null?void 0:Je.focusEditor)==null?void 0:Vt.call(Je)}),(tt||Ae!==iu)&&n(),!0)}catch(iu){return jt===Q&&(D.value=iu.message),!1}finally{jt===Q&&(g.value=!1)}}async function wt(k={}){const{auto:S=!1,silent:z=!1}=k;return f.value?oe()===$.value?!0:C||(lt(),v.value=!0,D.value="",C=(async()=>{try{const ne=await Er(f.value,{title:String(m.value.title||""),autoTitle:String(m.value.autoTitle||""),lastPromptPreview:String(m.value.lastPromptPreview||""),todoItems:yt(m.value.todoItems),codexSessionId:String(d.value[f.value]||m.value.codexSessionId||""),expiry:"none",visibility:"private",blocks:J(m.value.blocks)}),ke={title:String(ne.title||""),autoTitle:String(ne.autoTitle||""),lastPromptPreview:String(ne.lastPromptPreview||""),todoItems:yt(ne.todoItems||m.value.todoItems||[]),codexSessionId:String(d.value[f.value]||ne.codexSessionId||""),blocks:Qt(m.value.blocks)};return Le(f.value,ke),$.value=oe(ke.title,ke.autoTitle,ke.lastPromptPreview,ke.todoItems,ke.codexSessionId,ke.blocks),L.value=!1,Be(Mu(ne)),fe(f.value,ne.updatedAt||""),!S&&!z&&u(Re("taskActions.taskSaved")),!0}catch(ne){return D.value=ne.message,!1}finally{v.value=!1,C=null,oe()!==$.value&&(L.value=!0,xt())}})(),C):!1}async function Ut(){return x.value?(D.value=Re("taskActions.fileProcessing"),!1):C||(L.value?wt({auto:!1,silent:!0}):!0)}async function dt(){if(!await Ut()&&f.value)return!1;F.value=!0,D.value="";try{const k=await ws({title:"",expiry:"none",visibility:"private"}),S={title:String(k.title||""),autoTitle:String(k.autoTitle||""),lastPromptPreview:String(k.lastPromptPreview||""),codexSessionId:String(k.codexSessionId||""),blocks:Qt(k.blocks||[]),todoItems:yt(k.todoItems||[])};return Le(k.slug,S),Be(Mu(k),{insertAtStart:!0}),await We(k.slug,{focusEditor:!0}),u(Re("taskActions.taskCreated")),!0}catch(k){return D.value=k.message,!1}finally{F.value=!1}}async function Rt(k){const S=String(k||"").trim();!S||S===f.value||!await Ut()||await We(S)}async function at(){if(f.value){B.value=!0,D.value="";try{const k=f.value;await Ts(k),s.value=s.value.filter(ne=>ne.slug!==k);const S={...a.value};delete S[k],a.value=S;const z={...d.value};delete z[k],d.value=z;const re={...c.value};delete re[k],c.value=re,s.value.length?await We(s.value[0].slug,{focusEditor:!0}):(f.value="",an(""),m.value={title:"",autoTitle:"",lastPromptPreview:"",codexSessionId:"",blocks:[],todoItems:[]},$.value=oe("","","",[],"",[]),L.value=!1,await dt())}catch(k){D.value=k.message}finally{B.value=!1}}}function R(k={}){const{silent:S=!1}=k;f.value&&(m.value={...m.value,blocks:mr()},Le(f.value,m.value),Ke(),L.value=!0,De(()=>{var z,re;(re=(z=i.value)==null?void 0:z.focusEditor)==null||re.call(z)}),S||u(Re("taskActions.taskCleared")))}function V(){if(!f.value)return!1;const k=hi(m.value.blocks);return k.length?(m.value={...m.value,blocks:mr(),todoItems:[{id:Rh(),createdAt:new Date().toISOString(),blocks:k},...yt(m.value.todoItems)]},Le(f.value,m.value),Ke(),L.value=!0,De(()=>{var S,z;(z=(S=i.value)==null?void 0:S.focusEditor)==null||z.call(S)}),u(Re("taskActions.todoAdded")),!0):!1}function se(k=""){const S=String(k||"").trim();if(!f.value||!S)return!1;const z=yt(m.value.todoItems).filter(re=>re.id!==S);return z.length===yt(m.value.todoItems).length?!1:(m.value={...m.value,todoItems:z},Le(f.value,m.value),Ke(),L.value=!0,!0)}function he(k=""){const S=String(k||"").trim();if(!f.value||!S)return null;const z=yt(m.value.todoItems).find(re=>re.id===S);return z?(m.value={...m.value,blocks:Qt(z.blocks),todoItems:yt(m.value.todoItems).filter(re=>re.id!==S)},Le(f.value,m.value),Ke(),L.value=!0,De(()=>{var re,ne;(ne=(re=i.value)==null?void 0:re.focusEditor)==null||ne.call(re)}),z):null}async function Ce(){var ne;if(await xe(),!s.value.length){await dt();return}const k=jh();if(k){const ke=await We(k,{focusEditor:!0,force:!0});if(Vh(),ke)return}const S=((ne=s.value.find(ke=>!!(ke!=null&&ke.running)))==null?void 0:ne.slug)||"",z=Uh(),re=S||(s.value.some(ke=>ke.slug===z)?z:s.value[0].slug);await We(re,{focusEditor:!0,force:!0})}async function Dt(k){var S,z,re;x.value=!0,D.value="";try{const ne=((z=(S=i.value)==null?void 0:S.isImportedBlockActive)==null?void 0:z.call(S))||!1,ke=[];for(const tt of k){const Ae=await Cs(tt);ke.push({type:"image",content:dn(Ae.url),meta:{}})}(re=i.value)==null||re.insertUploadedBlocks(ke),u(Re("taskActions.imageInserted",{count:ke.length,appended:ne}))}catch(ne){D.value=ne.message}finally{x.value=!1}}async function tu(k){var S,z,re;D.value="";try{const ne=((z=(S=i.value)==null?void 0:S.isImportedBlockActive)==null?void 0:z.call(S))||!1,ke=[];for(const tt of k){const Ae=await tt.text();Ae.trim()&&ke.push({type:"imported_text",content:Ae,meta:{fileName:tt.name||Re("workbench.untitledTask"),collapsed:!0}})}if(!ke.length){u(Re("taskActions.noTextImported"));return}(re=i.value)==null||re.insertImportedBlocks(ke),u(Re("taskActions.importedBlocksInserted",{count:ke.length,appended:ne}))}catch{D.value=Re("taskActions.textImportFailed")}}async function Mt(k){var S;x.value=!0,D.value="";try{let z=0,re=0;for(const ne of k){const ke=await Es(ne),tt=(ke.blocks||[]).map(Ae=>({...Ae,content:Ae.type==="image"?dn(Ae.content):Ae.content}));tt.length&&((S=i.value)==null||S.insertBlocks(tt),z+=tt.length,re+=Number(ke.pageCount||0))}if(!z){u(Re("taskActions.noPdfContent"));return}u(Re("taskActions.pdfBlocksInserted",{blockCount:z,pageCount:re}))}catch(z){D.value=z.message||Re("taskActions.pdfImportFailed")}finally{x.value=!1}}function Tt(k){const S=k===f.value?m.value:$e(k);return S?Mh({title:String(S.title||""),blocks:J(S.blocks||[])},it(k)):""}function uu(k){const S=k===f.value?m.value:$e(k);return S?Qt(J(S.blocks||[])):[]}async function nu(k){return x.value?(D.value=Re("taskActions.fileProcessingBeforeSend"),!1):k!==f.value?!0:v.value&&C?C:L.value?wt({auto:!1,silent:!0}):!0}async function ou(k){return await nu(k)?Tt(k):""}function ru(k,S){const z=br(S);!z||k!==f.value||(m.value.lastPromptPreview=z,Le(f.value,m.value),Ke())}return Ee(m,()=>{if(g.value||!f.value)return;const k=co(m.value.blocks);!String(m.value.title||"").trim()&&k&&k!==m.value.autoTitle&&(m.value.autoTitle=k),Le(f.value,m.value),L.value=oe()!==$.value,Ke(),L.value&&!v.value&&xt()},{deep:!0}),Ee(f,k=>{k&&an(k)}),ft(()=>{lt(),bt()}),Ee(()=>o.listSyncVersion.value,()=>{Xe(o.listSyncTaskSlug.value),be(o.listSyncTaskSlug.value)}),{addCurrentDraftToTodo:V,applyTaskSettingsUpdate:ct,buildPromptForTask:Tt,getPromptBlocksForTask:uu,buildPromptPreview:br,clearCurrentTaskContent:R,createTaskAndSelect:dt,currentSelectedSessionId:ce,currentTaskSendState:ye,currentTaskAutoTitle:ae,currentTaskDisplayTitle:me,currentTaskSlug:f,draft:m,editorRef:i,error:D,handleImportPdfFiles:Mt,handleImportTextFiles:tu,handleTaskSendingChange:St,handleTaskSessionChange:st,handleUpload:Dt,hasCurrentDraftContent:T,hasAnyTaskSending:K,hasUnsavedChanges:L,initializeWorkbench:Ce,isCurrentTaskSending:j,loadingTask:g,loadingTasks:_,pageTitle:de,prepareCodexPromptForTask:ou,currentTodoItems:X,removeTodoItem:se,removeCurrentTask:at,removingTask:B,renderedTasks:U,refreshTaskList:xe,saveTask:wt,saving:v,selectTask:Rt,selectedSessionMap:d,sendingTaskMap:c,taskDraftMap:a,tasks:s,useTodoItem:he,updateLastPromptPreview:ru,uploading:x,creatingTask:F}}const Wh={class:"flex h-full min-h-0 flex-col overflow-hidden"},Kh={key:3,class:"grid min-h-0 flex-1 gap-4 lg:grid-cols-[260px_minmax(0,1fr)] lg:grid-rows-1"},Gh={class:"grid min-h-0 gap-4 overflow-hidden lg:grid-cols-2 lg:grid-rows-1"},Zh={class:"min-h-0 min-w-0 overflow-hidden"},Xh={class:"min-h-0 min-w-0 overflow-hidden"},Yh={key:4,class:"min-h-0 flex-1 overflow-hidden"},Jh={key:1,class:"flex h-full min-h-0 flex-col gap-1.5 overflow-hidden"},Qh={class:"workbench-mobile-tabs-panel shrink-0"},em={class:"workbench-mobile-tabs grid grid-cols-2 gap-2"},tm={class:"min-h-0 flex-1 overflow-hidden"},um={class:"h-full min-h-0"},nm={class:"h-full min-h-0"},om={__name:"WorkbenchView",setup(e){const t=H(!1),u=H(!1),n=H(!1),r=H(!1),o=H(!1),i=H(!1),s=H(!1),a=H(!1),d=H(""),c=H(""),f=H(""),m=H(0),_=H("workspace"),g=H(""),{t:F}=_t(),{toastMessage:B,flashToast:v,clearToast:x}=Ih(),D=Xn(()=>Yn(()=>import("./TaskDiffReviewDialog-0raSVHe9.js"),__vite__mapDeps([4,1,2]))),L=Xn(()=>Yn(()=>import("./WorkbenchSettingsDialog-Ccnbb1aO.js"),__vite__mapDeps([5,1,2,3]))),$=H(null);function te(I){return I?$.value:null}function C(){De(()=>{var I,Z;(Z=(I=te(T.value))==null?void 0:I.scrollToBottom)==null||Z.call(I)})}const{addCurrentDraftToTodo:Q,applyTaskSettingsUpdate:Y,buildPromptForTask:N,getPromptBlocksForTask:q,clearCurrentTaskContent:ue,createTaskAndSelect:ae,creatingTask:me,currentSelectedSessionId:ce,currentTaskSendState:ye,currentTaskAutoTitle:j,currentTaskDisplayTitle:K,currentTaskSlug:T,draft:X,editorRef:de,error:U,handleImportPdfFiles:W,handleImportTextFiles:J,handleTaskSendingChange:ge,handleTaskSessionChange:oe,handleUpload:Ie,hasCurrentDraftContent:_e,hasUnsavedChanges:Me,initializeWorkbench:$e,isCurrentTaskSending:fe,loadingTask:Ze,loadingTasks:Ye,pageTitle:Be,prepareCodexPromptForTask:Le,currentTodoItems:it,removeTodoItem:Xe,removeCurrentTask:St,removingTask:gt,renderedTasks:et,saveTask:st,saving:lt,selectTask:bt,updateLastPromptPreview:xt,useTodoItem:Ke,uploading:ct}=Hh({clearToast:x,flashToast:v,scrollCurrentPanelToBottom:C}),qe=le(()=>et.value.find(I=>I.slug===T.value)||null),Te=le(()=>{var I,Z;return!!((Z=(I=qe.value)==null?void 0:I.workspaceDiffSummary)!=null&&Z.supported)}),xe=le(()=>{const I=qe.value;return I?()=>Le(I.slug):null}),y=le(()=>{const I=qe.value;return I?()=>q(I.slug):null}),be=le(()=>({creatingTask:me.value,currentTaskAutoTitle:X.value.autoTitle||j.value,currentTaskSlug:T.value,draftTitle:X.value.title,editingTaskTitleSlug:f.value,error:U.value,isCurrentTaskSending:fe.value,loadingTask:Ze.value,loadingTasks:Ye.value,removingTask:gt.value,tasks:et.value,uploading:ct.value})),ze=le(()=>{var I,Z,G,Ue,je;return{buildPromptBlocks:y.value,buildPrompt:xe.value,diffSupported:Te.value,selectedSessionId:((I=qe.value)==null?void 0:I.codexSessionId)||"",sessionSelectionLockReason:((Z=qe.value)==null?void 0:Z.sessionSelectionLockReason)||"",sessionSelectionLocked:!!((G=qe.value)!=null&&G.sessionSelectionLocked),taskSlug:((Ue=qe.value)==null?void 0:Ue.slug)||"",taskRunning:!!((je=qe.value)!=null&&je.running)}}),We=le(()=>({canAddTodo:_e.value,codexSessionId:ce.value,isCurrentTaskSending:fe.value,sendState:ye.value,loading:Ze.value,todoCount:it.value.length,uploading:ct.value})),wt=le(()=>({currentTaskAutoTitle:X.value.autoTitle||j.value,currentTaskSlug:T.value,editingTaskTitleSlug:f.value,title:K.value,titleInputValue:X.value.title})),{enterMobileDetail:Ut,isMobileLayout:dt,leaveMobileDetail:Rt,mobileDetailTab:at,mobileView:R}=Eh({currentTaskSlug:T});function V(I){return I!=null&&I.sending||Number((I==null?void 0:I.codexRunCount)||0)>0?"activity":"input"}Dh(Be);function se(I="workspace",Z=""){_.value=I==="run"?"run":I==="task"?"task":"workspace",g.value=_.value==="run"?String(Z||""):"",n.value=!0,m.value+=1}function he(){n.value=!1}function Ce(){r.value=!0}function Dt(){r.value=!1}function tu(){T.value&&(o.value=!0)}function Mt(){o.value=!1}function Tt(){i.value=!0}function uu(){i.value=!1,nu(),ou()}function nu(){s.value=!1,d.value=""}function ou(){a.value=!1,c.value=""}function ru(I){Y(I)}function k(I){X.value.title=I}async function S(){f.value="",Me.value&&await st({auto:!1,silent:!0})}function z(I){I===T.value&&(f.value=I,De(()=>{var G,Ue;const Z=document.querySelector('[data-task-title-input="current"]');(G=Z==null?void 0:Z.focus)==null||G.call(Z),(Ue=Z==null?void 0:Z.select)==null||Ue.call(Z)}))}async function re(I){if(dt.value){await Vt(I);return}if(I!==T.value){await Vt(I);return}z(I)}function ne(){u.value=!0}function ke(){gt.value||(u.value=!1)}async function tt(){await St(),u.value=!1,dt.value&&Rt({useHistory:!1})}function Ae(){t.value=!0}function jt(){t.value=!1}function iu(){t.value=!1,ue()}function bu(I){const Z=qe.value;Z&&ge(Z.slug,I)}function Au(I){const Z=qe.value;Z&&oe(Z.slug,I)}async function pt(){var I,Z,G,Ue,je,vt,ut,su;typeof document<"u"&&((Z=(I=de.value)==null?void 0:I.isComposing)!=null&&Z.call(I))&&((Ue=(G=document.activeElement)==null?void 0:G.blur)==null||Ue.call(G)),(vt=(je=de.value)==null?void 0:je.flushPendingInput)==null||vt.call(je),await De(),(su=(ut=de.value)==null?void 0:ut.flushPendingInput)==null||su.call(ut),await De()}async function Pt(){await pt(),await navigator.clipboard.writeText(N(T.value)),v(F("workbench.promptCopied"))}async function Je(){await ae()&&dt.value&&(at.value="input",Ut())}async function Vt(I){const Z=String(I||"").trim();Z&&(Z!==T.value&&await bt(Z),dt.value&&T.value===Z&&(at.value=V(qe.value),Ut()))}async function Zu(){await pt(),Q()}function Xu(I){d.value=String(I||"").trim(),s.value=!!d.value}function Yu(){d.value&&(Xe(d.value),nu())}async function Ju(I=c.value){const Z=String(I||"").trim();return!Z||!Ke(Z)?!1:(ou(),uu(),!0)}async function Fn(I){await pt();const Z=String(I||"").trim();if(Z){if(!_e.value){await Ju(Z);return}c.value=Z,a.value=!0}}async function Du(){var Ue,je,vt,ut;const I=T.value;if(!I)return;const Z=!!((je=(Ue=qe.value)==null?void 0:Ue.automation)!=null&&je.enabled);await pt(),xt(I,N(I)),!(!await((ut=(vt=te(I))==null?void 0:vt.send)==null?void 0:ut.call(vt))||I!==T.value)&&(dt.value&&(at.value="activity"),Z||ue({silent:!0}),await st({auto:!1,silent:!0}))}function $n(){!dt.value||R.value!=="detail"||at.value!=="input"||!T.value||De(()=>{var I,Z;(Z=(I=de.value)==null?void 0:I.focusEditor)==null||Z.call(I)})}function h(I){!Me.value&&!ct.value&&!lt.value||(I.preventDefault(),I.returnValue="")}function b(I){if(!I.metaKey&&!I.ctrlKey&&I.shiftKey&&I.key==="Enter"){I.preventDefault(),Du();return}if(I.metaKey||I.ctrlKey){if(I.key.toLowerCase()==="s"){I.preventDefault(),st({auto:!1});return}I.shiftKey&&I.key==="Backspace"&&(I.preventDefault(),Ae())}}mu(()=>{$e(),window.addEventListener("beforeunload",h),window.addEventListener("keydown",b)}),ft(()=>{window.removeEventListener("beforeunload",h),window.removeEventListener("keydown",b)}),Ee([dt,R,at,T],([I,Z,G,Ue])=>{!I||Z!=="detail"||G!=="input"||!Ue||$n()});const w={"update:draftTitle":k,"cancel-title-edit":()=>{f.value=""},"create-task":Je,"edit-task":tu,"delete-task":ne,"open-settings":Ce,"select-task":Vt,"title-blur":S,"title-click":re},M={"open-diff":({scope:I,runId:Z})=>se(I,Z),"project-created":()=>v(F("workbench.projectCreated")),"selected-session-change":Au,"sending-change":bu},ee={"add-todo":Zu,"clear-request":Ae,"copy-request":Pt,"import-pdf-files":W,"import-text-files":J,"manage-todo":Tt,"send-request":Du,"upload-files":Ie},pe={"begin-edit":()=>z(T.value),back:Rt,"cancel-title-edit":()=>{f.value=""},"title-blur":S,"update:titleInputValue":k};return(I,Z)=>(E(),O("div",Wh,[ie(wh,{message:l(B)},null,8,["message"]),ie(un,{open:t.value,title:l(F)("workbench.confirmClearTitle"),description:l(F)("workbench.confirmClearDescription"),"confirm-text":l(F)("workbench.confirmClearAction"),"cancel-text":l(F)("workbench.continueEditing"),onCancel:jt,onConfirm:iu},null,8,["open","title","description","confirm-text","cancel-text"]),ie(un,{open:u.value,title:l(F)("workbench.confirmDeleteTitle"),description:l(F)("workbench.confirmDeleteDescription",{title:l(K)}),"confirm-text":l(F)("workbench.confirmDeleteAction"),"cancel-text":l(F)("workbench.keepForNow"),loading:l(gt),danger:"",onCancel:ke,onConfirm:tt},null,8,["open","title","description","confirm-text","cancel-text","loading"]),ie(un,{open:s.value,title:l(F)("workbench.confirmDeleteTodoTitle"),description:l(F)("workbench.confirmDeleteTodoDescription"),"confirm-text":l(F)("workbench.confirmDeleteAction"),"cancel-text":l(F)("workbench.keepForNow"),danger:"",onCancel:nu,onConfirm:Yu},null,8,["open","title","description","confirm-text","cancel-text"]),ie(un,{open:a.value,title:l(F)("workbench.replaceEditorTitle"),description:l(F)("workbench.replaceEditorDescription"),"confirm-text":l(F)("workbench.confirmReplaceAction"),"cancel-text":l(F)("workbench.dontReplaceYet"),onCancel:ou,onConfirm:Z[0]||(Z[0]=G=>Ju())},null,8,["open","title","description","confirm-text","cancel-text"]),ie(kh,{open:i.value,items:l(it),onClose:uu,onDelete:Xu,onUse:Fn},null,8,["open","items"]),n.value?(E(),we(l(D),{key:0,open:n.value,"task-slug":l(T),"task-title":l(K),"preferred-scope":_.value,"preferred-run-id":g.value,"focus-token":m.value,onClose:he},null,8,["open","task-slug","task-title","preferred-scope","preferred-run-id","focus-token"])):ve("",!0),r.value?(E(),we(l(L),{key:1,open:r.value,onClose:Dt},null,8,["open"])):ve("",!0),o.value?(E(),we(ol,{key:2,open:o.value,"task-slug":l(T),"task-title":l(K),onClose:Mt,onSaved:ru},null,8,["open","task-slug","task-title"])):ve("",!0),l(dt)?(E(),O("div",Yh,[l(R)==="tasks"?(E(),we(pr,au({key:0},be.value,{mobile:""},lu(w)),null,16)):(E(),O("div",Jh,[ie(Tp,au(wt.value,lu(pe)),null,16),p("section",Qh,[p("div",em,[p("button",{type:"button",class:Se(["tool-button px-3 py-1.5 text-sm",l(at)==="activity"?"tool-button-accent-subtle":""]),onClick:Z[2]||(Z[2]=G=>at.value="activity")},A(l(F)("workbench.activity")),3),p("button",{type:"button",class:Se(["tool-button px-3 py-1.5 text-sm",l(at)==="input"?"tool-button-accent-subtle":""]),onClick:Z[3]||(Z[3]=G=>at.value="input")},A(l(F)("workbench.input")),3)])]),p("div",tm,[Zt(p("div",um,[ie(dr,au({ref_key:"codexPanelRef",ref:$},ze.value,{"empty-message":l(F)("workbench.selectTask")},lu(M)),null,16,["empty-message"])],512),[[Ao,l(at)==="activity"]]),Zt(p("div",nm,[ie(fr,au({ref_key:"editorRef",ref:de,modelValue:l(X).blocks,"onUpdate:modelValue":Z[4]||(Z[4]=G=>l(X).blocks=G)},We.value,lu(ee)),null,16,["modelValue"])],512),[[Ao,l(at)==="input"]])])]))])):(E(),O("div",Kh,[ie(pr,au(be.value,lu(w)),null,16),p("div",Gh,[p("div",Zh,[qe.value?(E(),we(dr,au({key:0,ref_key:"codexPanelRef",ref:$},ze.value,lu(M)),null,16)):ve("",!0)]),p("div",Xh,[ie(fr,au({ref_key:"editorRef",ref:de,modelValue:l(X).blocks,"onUpdate:modelValue":Z[1]||(Z[1]=G=>l(X).blocks=G)},We.value,lu(ee)),null,16,["modelValue"])])])]))]))}},cm=Object.freeze(Object.defineProperty({__proto__:null,default:om},Symbol.toStringTag,{value:"Module"}));export{Sr as A,Ai as B,Mn as C,$o as F,Ot as L,kr as P,Bi as S,Nu as T,cm as W,Cn as X,Kt as _,Lu as a,Th as b,Fe as c,Di as d,vr as e,tn as f,lm as g,Li as h,ps as i,im as j,Ge as k,Rs as l,Ii as m,wr as n,sm as o,un as p,Ou as q,He as r,am as s,Ti as t,Br as u};