detached 98d36bf

mr_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13import (
14	"strconv"
15	"strings"
16)
17
18// MRList is the list of the merge requests of a repository: the open ones,
19// then the merged and closed ones.
20func MRList(l Layout, p MRListPage) templ.Component {
21	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
22		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
23		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
24			return templ_7745c5c3_CtxErr
25		}
26		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
27		if !templ_7745c5c3_IsBuffer {
28			defer func() {
29				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
30				if templ_7745c5c3_Err == nil {
31					templ_7745c5c3_Err = templ_7745c5c3_BufErr
32				}
33			}()
34		}
35		ctx = templ.InitializeContext(ctx)
36		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
37		if templ_7745c5c3_Var1 == nil {
38			templ_7745c5c3_Var1 = templ.NopComponent
39		}
40		ctx = templ.ClearChildren(ctx)
41		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
42			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
43			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
44			if !templ_7745c5c3_IsBuffer {
45				defer func() {
46					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
47					if templ_7745c5c3_Err == nil {
48						templ_7745c5c3_Err = templ_7745c5c3_BufErr
49					}
50				}()
51			}
52			ctx = templ.InitializeContext(ctx)
53			if p.Live {
54				templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
55				if templ_7745c5c3_Err != nil {
56					return templ_7745c5c3_Err
57				}
58				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " <div id=\"mr-refresh-status\" role=\"status\" aria-live=\"polite\"></div>")
59				if templ_7745c5c3_Err != nil {
60					return templ_7745c5c3_Err
61				}
62			}
63			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " <div class=\"filter\"><label for=\"mr-filter\" class=\"sr\">filter</label> <input id=\"mr-filter\" type=\"search\" data-filter=\".mrs tbody tr\" placeholder=\"Filter by title, branch, author or state…\" autocomplete=\"off\" hx-on:input=\"ermite.filter(this)\"></div>")
64			if templ_7745c5c3_Err != nil {
65				return templ_7745c5c3_Err
66			}
67			if p.Newest == "" {
68				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<h2 class=\"rule-h\"><span>Open</span><span class=\"count\">")
69				if templ_7745c5c3_Err != nil {
70					return templ_7745c5c3_Err
71				}
72				var templ_7745c5c3_Var3 string
73				templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Open)))
74				if templ_7745c5c3_Err != nil {
75					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 30, Col: 78}
76				}
77				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
78				if templ_7745c5c3_Err != nil {
79					return templ_7745c5c3_Err
80				}
81				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</span></h2>")
82				if templ_7745c5c3_Err != nil {
83					return templ_7745c5c3_Err
84				}
85				templ_7745c5c3_Err = mrRows(p.Open, "Open merge requests").Render(ctx, templ_7745c5c3_Buffer)
86				if templ_7745c5c3_Err != nil {
87					return templ_7745c5c3_Err
88				}
89				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, " ")
90				if templ_7745c5c3_Err != nil {
91					return templ_7745c5c3_Err
92				}
93				if len(p.Open) == 0 {
94					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<p class=\"lede dim\">no open merge requests.</p>")
95					if templ_7745c5c3_Err != nil {
96						return templ_7745c5c3_Err
97					}
98				}
99				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ")
100				if templ_7745c5c3_Err != nil {
101					return templ_7745c5c3_Err
102				}
103				if p.OpenNote != "" {
104					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<p class=\"note\">")
105					if templ_7745c5c3_Err != nil {
106						return templ_7745c5c3_Err
107					}
108					var templ_7745c5c3_Var4 string
109					templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.OpenNote)
110					if templ_7745c5c3_Err != nil {
111						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 36, Col: 32}
112					}
113					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
114					if templ_7745c5c3_Err != nil {
115						return templ_7745c5c3_Err
116					}
117					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</p>")
118					if templ_7745c5c3_Err != nil {
119						return templ_7745c5c3_Err
120					}
121				}
122			}
123			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " <h2 class=\"rule-h\"><span>Merged and closed</span><span class=\"count\">")
124			if templ_7745c5c3_Err != nil {
125				return templ_7745c5c3_Err
126			}
127			var templ_7745c5c3_Var5 string
128			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Done)))
129			if templ_7745c5c3_Err != nil {
130				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 39, Col: 90}
131			}
132			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
133			if templ_7745c5c3_Err != nil {
134				return templ_7745c5c3_Err
135			}
136			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</span></h2>")
137			if templ_7745c5c3_Err != nil {
138				return templ_7745c5c3_Err
139			}
140			templ_7745c5c3_Err = mrRows(p.Done, "Merged and closed merge requests").Render(ctx, templ_7745c5c3_Buffer)
141			if templ_7745c5c3_Err != nil {
142				return templ_7745c5c3_Err
143			}
144			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ")
145			if templ_7745c5c3_Err != nil {
146				return templ_7745c5c3_Err
147			}
148			if len(p.Done) == 0 {
149				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<p class=\"lede dim\">nothing merged or closed yet.</p>")
150				if templ_7745c5c3_Err != nil {
151					return templ_7745c5c3_Err
152				}
153			}
154			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " ")
155			if templ_7745c5c3_Err != nil {
156				return templ_7745c5c3_Err
157			}
158			if p.Older != "" || p.Newest != "" {
159				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<nav class=\"pager\" aria-label=\"Pages\">")
160				if templ_7745c5c3_Err != nil {
161					return templ_7745c5c3_Err
162				}
163				if p.Newest != "" {
164					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<a class=\"btn\" href=\"")
165					if templ_7745c5c3_Err != nil {
166						return templ_7745c5c3_Err
167					}
168					var templ_7745c5c3_Var6 templ.SafeURL
169					templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Newest))
170					if templ_7745c5c3_Err != nil {
171						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 47, Col: 50}
172					}
173					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
174					if templ_7745c5c3_Err != nil {
175						return templ_7745c5c3_Err
176					}
177					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\">← Newest</a> ")
178					if templ_7745c5c3_Err != nil {
179						return templ_7745c5c3_Err
180					}
181				} else {
182					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<span class=\"btn\" aria-disabled=\"true\">← Newest</span> ")
183					if templ_7745c5c3_Err != nil {
184						return templ_7745c5c3_Err
185					}
186				}
187				if p.Older != "" {
188					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<a class=\"btn\" href=\"")
189					if templ_7745c5c3_Err != nil {
190						return templ_7745c5c3_Err
191					}
192					var templ_7745c5c3_Var7 templ.SafeURL
193					templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Older))
194					if templ_7745c5c3_Err != nil {
195						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 52, Col: 49}
196					}
197					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
198					if templ_7745c5c3_Err != nil {
199						return templ_7745c5c3_Err
200					}
201					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\" rel=\"next\">Older →</a>")
202					if templ_7745c5c3_Err != nil {
203						return templ_7745c5c3_Err
204					}
205				} else {
206					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<span class=\"btn\" aria-disabled=\"true\">Older →</span>")
207					if templ_7745c5c3_Err != nil {
208						return templ_7745c5c3_Err
209					}
210				}
211				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</nav>")
212				if templ_7745c5c3_Err != nil {
213					return templ_7745c5c3_Err
214				}
215			}
216			return nil
217		})
218		templ_7745c5c3_Err = Shell(l, mrListRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
219		if templ_7745c5c3_Err != nil {
220			return templ_7745c5c3_Err
221		}
222		return nil
223	})
224}
225
226func mrRows(rows []MRRow, label string) templ.Component {
227	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
228		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
229		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
230			return templ_7745c5c3_CtxErr
231		}
232		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
233		if !templ_7745c5c3_IsBuffer {
234			defer func() {
235				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
236				if templ_7745c5c3_Err == nil {
237					templ_7745c5c3_Err = templ_7745c5c3_BufErr
238				}
239			}()
240		}
241		ctx = templ.InitializeContext(ctx)
242		templ_7745c5c3_Var8 := templ.GetChildren(ctx)
243		if templ_7745c5c3_Var8 == nil {
244			templ_7745c5c3_Var8 = templ.NopComponent
245		}
246		ctx = templ.ClearChildren(ctx)
247		if len(rows) > 0 {
248			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<table class=\"list mrs\" aria-label=\"")
249			if templ_7745c5c3_Err != nil {
250				return templ_7745c5c3_Err
251			}
252			var templ_7745c5c3_Var9 string
253			templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(label)
254			if templ_7745c5c3_Err != nil {
255				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 63, Col: 44}
256			}
257			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
258			if templ_7745c5c3_Err != nil {
259				return templ_7745c5c3_Err
260			}
261			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"><tbody data-rows>")
262			if templ_7745c5c3_Err != nil {
263				return templ_7745c5c3_Err
264			}
265			for _, m := range rows {
266				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<tr")
267				if templ_7745c5c3_Err != nil {
268					return templ_7745c5c3_Err
269				}
270				if m.Cursor {
271					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " data-cursor")
272					if templ_7745c5c3_Err != nil {
273						return templ_7745c5c3_Err
274					}
275				}
276				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, " data-state=\"")
277				if templ_7745c5c3_Err != nil {
278					return templ_7745c5c3_Err
279				}
280				var templ_7745c5c3_Var10 string
281				templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.State)
282				if templ_7745c5c3_Err != nil {
283					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 66, Col: 55}
284				}
285				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
286				if templ_7745c5c3_Err != nil {
287					return templ_7745c5c3_Err
288				}
289				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\"><td class=\"c-n mute\">")
290				if templ_7745c5c3_Err != nil {
291					return templ_7745c5c3_Err
292				}
293				var templ_7745c5c3_Var11 string
294				templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(m.Number)
295				if templ_7745c5c3_Err != nil {
296					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 67, Col: 37}
297				}
298				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
299				if templ_7745c5c3_Err != nil {
300					return templ_7745c5c3_Err
301				}
302				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</td><td class=\"c-state\">")
303				if templ_7745c5c3_Err != nil {
304					return templ_7745c5c3_Err
305				}
306				var templ_7745c5c3_Var12 string
307				templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(m.State)
308				if templ_7745c5c3_Err != nil {
309					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 68, Col: 35}
310				}
311				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
312				if templ_7745c5c3_Err != nil {
313					return templ_7745c5c3_Err
314				}
315				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</td><td class=\"c-subject\"><a href=\"")
316				if templ_7745c5c3_Err != nil {
317					return templ_7745c5c3_Err
318				}
319				var templ_7745c5c3_Var13 templ.SafeURL
320				templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(m.Href))
321				if templ_7745c5c3_Err != nil {
322					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 59}
323				}
324				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
325				if templ_7745c5c3_Err != nil {
326					return templ_7745c5c3_Err
327				}
328				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "\">")
329				if templ_7745c5c3_Err != nil {
330					return templ_7745c5c3_Err
331				}
332				var templ_7745c5c3_Var14 string
333				templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
334				if templ_7745c5c3_Err != nil {
335					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 71}
336				}
337				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
338				if templ_7745c5c3_Err != nil {
339					return templ_7745c5c3_Err
340				}
341				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</a> <span class=\"mute\">")
342				if templ_7745c5c3_Err != nil {
343					return templ_7745c5c3_Err
344				}
345				var templ_7745c5c3_Var15 string
346				templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(m.Branches)
347				if templ_7745c5c3_Err != nil {
348					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 109}
349				}
350				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
351				if templ_7745c5c3_Err != nil {
352					return templ_7745c5c3_Err
353				}
354				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</span></td><td class=\"c-who dim\">")
355				if templ_7745c5c3_Err != nil {
356					return templ_7745c5c3_Err
357				}
358				var templ_7745c5c3_Var16 string
359				templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(m.Author)
360				if templ_7745c5c3_Err != nil {
361					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 70, Col: 38}
362				}
363				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
364				if templ_7745c5c3_Err != nil {
365					return templ_7745c5c3_Err
366				}
367				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</td><td class=\"c-when nowrap dim\">")
368				if templ_7745c5c3_Err != nil {
369					return templ_7745c5c3_Err
370				}
371				if m.WhenAt != "" {
372					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<time datetime=\"")
373					if templ_7745c5c3_Err != nil {
374						return templ_7745c5c3_Err
375					}
376					var templ_7745c5c3_Var17 string
377					templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
378					if templ_7745c5c3_Err != nil {
379						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 33}
380					}
381					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
382					if templ_7745c5c3_Err != nil {
383						return templ_7745c5c3_Err
384					}
385					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\" title=\"")
386					if templ_7745c5c3_Err != nil {
387						return templ_7745c5c3_Err
388					}
389					var templ_7745c5c3_Var18 string
390					templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
391					if templ_7745c5c3_Err != nil {
392						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 52}
393					}
394					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
395					if templ_7745c5c3_Err != nil {
396						return templ_7745c5c3_Err
397					}
398					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\">")
399					if templ_7745c5c3_Err != nil {
400						return templ_7745c5c3_Err
401					}
402					var templ_7745c5c3_Var19 string
403					templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(m.When)
404					if templ_7745c5c3_Err != nil {
405						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 63}
406					}
407					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
408					if templ_7745c5c3_Err != nil {
409						return templ_7745c5c3_Err
410					}
411					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</time>")
412					if templ_7745c5c3_Err != nil {
413						return templ_7745c5c3_Err
414					}
415				}
416				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</td></tr>")
417				if templ_7745c5c3_Err != nil {
418					return templ_7745c5c3_Err
419				}
420			}
421			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</tbody></table>")
422			if templ_7745c5c3_Err != nil {
423				return templ_7745c5c3_Err
424			}
425		}
426		return nil
427	})
428}
429
430func mrListRail(p MRListPage) templ.Component {
431	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
432		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
433		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
434			return templ_7745c5c3_CtxErr
435		}
436		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
437		if !templ_7745c5c3_IsBuffer {
438			defer func() {
439				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
440				if templ_7745c5c3_Err == nil {
441					templ_7745c5c3_Err = templ_7745c5c3_BufErr
442				}
443			}()
444		}
445		ctx = templ.InitializeContext(ctx)
446		templ_7745c5c3_Var20 := templ.GetChildren(ctx)
447		if templ_7745c5c3_Var20 == nil {
448			templ_7745c5c3_Var20 = templ.NopComponent
449		}
450		ctx = templ.ClearChildren(ctx)
451		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<section aria-labelledby=\"r-states\"><h2 id=\"r-states\">States</h2><dl class=\"kv\"><dt>open</dt><dd>awaits review</dd><dt>merged</dt><dd>the target took the branch</dd><dt>closed</dt><dd>refused, branch kept</dd></dl></section><section aria-labelledby=\"r-new\"><h2 id=\"r-new\">Open one</h2>")
452		if templ_7745c5c3_Err != nil {
453			return templ_7745c5c3_Err
454		}
455		if len(p.Branches) > 0 {
456			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<p class=\"dim\">compare a branch with ")
457			if templ_7745c5c3_Err != nil {
458				return templ_7745c5c3_Err
459			}
460			var templ_7745c5c3_Var21 string
461			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Default)
462			if templ_7745c5c3_Err != nil {
463				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 98, Col: 51}
464			}
465			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
466			if templ_7745c5c3_Err != nil {
467				return templ_7745c5c3_Err
468			}
469			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, ":</p><nav class=\"outline\" aria-label=\"Branches\">")
470			if templ_7745c5c3_Err != nil {
471				return templ_7745c5c3_Err
472			}
473			for _, b := range p.Branches {
474				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<a href=\"")
475				if templ_7745c5c3_Err != nil {
476					return templ_7745c5c3_Err
477				}
478				var templ_7745c5c3_Var22 templ.SafeURL
479				templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(b.Href))
480				if templ_7745c5c3_Err != nil {
481					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 101, Col: 36}
482				}
483				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
484				if templ_7745c5c3_Err != nil {
485					return templ_7745c5c3_Err
486				}
487				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "\">")
488				if templ_7745c5c3_Err != nil {
489					return templ_7745c5c3_Err
490				}
491				var templ_7745c5c3_Var23 string
492				templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(b.Name)
493				if templ_7745c5c3_Err != nil {
494					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 101, Col: 47}
495				}
496				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
497				if templ_7745c5c3_Err != nil {
498					return templ_7745c5c3_Err
499				}
500				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</a>")
501				if templ_7745c5c3_Err != nil {
502					return templ_7745c5c3_Err
503				}
504			}
505			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</nav>")
506			if templ_7745c5c3_Err != nil {
507				return templ_7745c5c3_Err
508			}
509		} else {
510			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<p class=\"dim\">there is no other branch to merge yet.</p>")
511			if templ_7745c5c3_Err != nil {
512				return templ_7745c5c3_Err
513			}
514		}
515		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
516		if templ_7745c5c3_Err != nil {
517			return templ_7745c5c3_Err
518		}
519		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</section>")
520		if templ_7745c5c3_Err != nil {
521			return templ_7745c5c3_Err
522		}
523		return nil
524	})
525}
526
527// MergeRequest is a merge request: its facts, its description, the diff with
528// the notes under their lines, the general comments. The merge and More menus
529// sit in the toolbar, the commits and checks in the card footer, and the rail
530// holds the files and verdicts.
531func MergeRequest(l Layout, p MRPage) templ.Component {
532	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
533		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
534		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
535			return templ_7745c5c3_CtxErr
536		}
537		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
538		if !templ_7745c5c3_IsBuffer {
539			defer func() {
540				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
541				if templ_7745c5c3_Err == nil {
542					templ_7745c5c3_Err = templ_7745c5c3_BufErr
543				}
544			}()
545		}
546		ctx = templ.InitializeContext(ctx)
547		templ_7745c5c3_Var24 := templ.GetChildren(ctx)
548		if templ_7745c5c3_Var24 == nil {
549			templ_7745c5c3_Var24 = templ.NopComponent
550		}
551		ctx = templ.ClearChildren(ctx)
552		templ_7745c5c3_Var25 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
553			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
554			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
555			if !templ_7745c5c3_IsBuffer {
556				defer func() {
557					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
558					if templ_7745c5c3_Err == nil {
559						templ_7745c5c3_Err = templ_7745c5c3_BufErr
560					}
561				}()
562			}
563			ctx = templ.InitializeContext(ctx)
564			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<section class=\"mr-card\"><header class=\"show mr-h\"><h1><span class=\"mute\">")
565			if templ_7745c5c3_Err != nil {
566				return templ_7745c5c3_Err
567			}
568			var templ_7745c5c3_Var26 string
569			templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.Number)
570			if templ_7745c5c3_Err != nil {
571				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 37}
572			}
573			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
574			if templ_7745c5c3_Err != nil {
575				return templ_7745c5c3_Err
576			}
577			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</span> ")
578			if templ_7745c5c3_Err != nil {
579				return templ_7745c5c3_Err
580			}
581			var templ_7745c5c3_Var27 string
582			templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title)
583			if templ_7745c5c3_Err != nil {
584				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 56}
585			}
586			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
587			if templ_7745c5c3_Err != nil {
588				return templ_7745c5c3_Err
589			}
590			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</h1><dl class=\"kv show-kv\"><dt>state</dt><dd class=\"mr-state\" data-state=\"")
591			if templ_7745c5c3_Err != nil {
592				return templ_7745c5c3_Err
593			}
594			var templ_7745c5c3_Var28 string
595			templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.State)
596			if templ_7745c5c3_Err != nil {
597				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 122, Col: 46}
598			}
599			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var28)
600			if templ_7745c5c3_Err != nil {
601				return templ_7745c5c3_Err
602			}
603			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "\">")
604			if templ_7745c5c3_Err != nil {
605				return templ_7745c5c3_Err
606			}
607			var templ_7745c5c3_Var29 string
608			templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(p.State)
609			if templ_7745c5c3_Err != nil {
610				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 123, Col: 15}
611			}
612			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
613			if templ_7745c5c3_Err != nil {
614				return templ_7745c5c3_Err
615			}
616			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, " ")
617			if templ_7745c5c3_Err != nil {
618				return templ_7745c5c3_Err
619			}
620			if p.MergedShort != "" {
621				var templ_7745c5c3_Var30 string
622				templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
623				if templ_7745c5c3_Err != nil {
624					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 125, Col: 15}
625				}
626				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
627				if templ_7745c5c3_Err != nil {
628					return templ_7745c5c3_Err
629				}
630				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "<a href=\"")
631				if templ_7745c5c3_Err != nil {
632					return templ_7745c5c3_Err
633				}
634				var templ_7745c5c3_Var31 templ.SafeURL
635				templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.MergedHref))
636				if templ_7745c5c3_Err != nil {
637					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 125, Col: 54}
638				}
639				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31))
640				if templ_7745c5c3_Err != nil {
641					return templ_7745c5c3_Err
642				}
643				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "\">")
644				if templ_7745c5c3_Err != nil {
645					return templ_7745c5c3_Err
646				}
647				var templ_7745c5c3_Var32 string
648				templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergedShort)
649				if templ_7745c5c3_Err != nil {
650					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 125, Col: 72}
651				}
652				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var32))
653				if templ_7745c5c3_Err != nil {
654					return templ_7745c5c3_Err
655				}
656				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "</a>")
657				if templ_7745c5c3_Err != nil {
658					return templ_7745c5c3_Err
659				}
660				var templ_7745c5c3_Var33 string
661				templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + p.MergeMode)
662				if templ_7745c5c3_Err != nil {
663					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 125, Col: 100}
664				}
665				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
666				if templ_7745c5c3_Err != nil {
667					return templ_7745c5c3_Err
668				}
669			}
670			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "</dd><dt>branch</dt><dd>")
671			if templ_7745c5c3_Err != nil {
672				return templ_7745c5c3_Err
673			}
674			templ_7745c5c3_Err = branchLink(p.Source, p.SourceHref).Render(ctx, templ_7745c5c3_Buffer)
675			if templ_7745c5c3_Err != nil {
676				return templ_7745c5c3_Err
677			}
678			var templ_7745c5c3_Var34 string
679			templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.JoinStringErrs(" → ")
680			if templ_7745c5c3_Err != nil {
681				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 131, Col: 15}
682			}
683			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var34))
684			if templ_7745c5c3_Err != nil {
685				return templ_7745c5c3_Err
686			}
687			templ_7745c5c3_Err = branchLink(p.Target, p.TargetHref).Render(ctx, templ_7745c5c3_Buffer)
688			if templ_7745c5c3_Err != nil {
689				return templ_7745c5c3_Err
690			}
691			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</dd><dt>opened</dt><dd>")
692			if templ_7745c5c3_Err != nil {
693				return templ_7745c5c3_Err
694			}
695			var templ_7745c5c3_Var35 string
696			templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.Name)
697			if templ_7745c5c3_Err != nil {
698				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 136, Col: 21}
699			}
700			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
701			if templ_7745c5c3_Err != nil {
702				return templ_7745c5c3_Err
703			}
704			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, " ")
705			if templ_7745c5c3_Err != nil {
706				return templ_7745c5c3_Err
707			}
708			if p.Opened.WhenAt != "" {
709				var templ_7745c5c3_Var36 string
710				templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
711				if templ_7745c5c3_Err != nil {
712					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 15}
713				}
714				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
715				if templ_7745c5c3_Err != nil {
716					return templ_7745c5c3_Err
717				}
718				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "<time datetime=\"")
719				if templ_7745c5c3_Err != nil {
720					return templ_7745c5c3_Err
721				}
722				var templ_7745c5c3_Var37 string
723				templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.WhenAt)
724				if templ_7745c5c3_Err != nil {
725					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 49}
726				}
727				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var37)
728				if templ_7745c5c3_Err != nil {
729					return templ_7745c5c3_Err
730				}
731				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\" title=\"")
732				if templ_7745c5c3_Err != nil {
733					return templ_7745c5c3_Err
734				}
735				var templ_7745c5c3_Var38 string
736				templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.Abs)
737				if templ_7745c5c3_Err != nil {
738					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 72}
739				}
740				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var38)
741				if templ_7745c5c3_Err != nil {
742					return templ_7745c5c3_Err
743				}
744				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "\">")
745				if templ_7745c5c3_Err != nil {
746					return templ_7745c5c3_Err
747				}
748				var templ_7745c5c3_Var39 string
749				templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.When)
750				if templ_7745c5c3_Err != nil {
751					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 90}
752				}
753				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
754				if templ_7745c5c3_Err != nil {
755					return templ_7745c5c3_Err
756				}
757				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</time>")
758				if templ_7745c5c3_Err != nil {
759					return templ_7745c5c3_Err
760				}
761			}
762			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "</dd>")
763			if templ_7745c5c3_Err != nil {
764				return templ_7745c5c3_Err
765			}
766			if p.UpdatedAt != "" {
767				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "<dt>updated</dt><dd><time datetime=\"")
768				if templ_7745c5c3_Err != nil {
769					return templ_7745c5c3_Err
770				}
771				var templ_7745c5c3_Var40 string
772				templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.UpdatedAt)
773				if templ_7745c5c3_Err != nil {
774					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 143, Col: 38}
775				}
776				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var40)
777				if templ_7745c5c3_Err != nil {
778					return templ_7745c5c3_Err
779				}
780				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "\">")
781				if templ_7745c5c3_Err != nil {
782					return templ_7745c5c3_Err
783				}
784				var templ_7745c5c3_Var41 string
785				templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(p.Updated)
786				if templ_7745c5c3_Err != nil {
787					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 143, Col: 52}
788				}
789				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
790				if templ_7745c5c3_Err != nil {
791					return templ_7745c5c3_Err
792				}
793				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "</time></dd>")
794				if templ_7745c5c3_Err != nil {
795					return templ_7745c5c3_Err
796				}
797			}
798			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, "</dl></header>")
799			if templ_7745c5c3_Err != nil {
800				return templ_7745c5c3_Err
801			}
802			if p.Desc != "" {
803				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, "<article class=\"mr-desc prose\" aria-label=\"description\" hx-ignore>")
804				if templ_7745c5c3_Err != nil {
805					return templ_7745c5c3_Err
806				}
807				templ_7745c5c3_Err = templ.Raw(string(p.Desc)).Render(ctx, templ_7745c5c3_Buffer)
808				if templ_7745c5c3_Err != nil {
809					return templ_7745c5c3_Err
810				}
811				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "</article>")
812				if templ_7745c5c3_Err != nil {
813					return templ_7745c5c3_Err
814				}
815			}
816			templ_7745c5c3_Err = mrFooter(p).Render(ctx, templ_7745c5c3_Buffer)
817			if templ_7745c5c3_Err != nil {
818				return templ_7745c5c3_Err
819			}
820			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</section>")
821			if templ_7745c5c3_Err != nil {
822				return templ_7745c5c3_Err
823			}
824			if p.Deleting != "" {
825				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, "<p class=\"note\" role=\"status\">merged. the branch ")
826				if templ_7745c5c3_Err != nil {
827					return templ_7745c5c3_Err
828				}
829				var templ_7745c5c3_Var42 string
830				templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(p.Deleting)
831				if templ_7745c5c3_Err != nil {
832					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 155, Col: 64}
833				}
834				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
835				if templ_7745c5c3_Err != nil {
836					return templ_7745c5c3_Err
837				}
838				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, " is being deleted.</p>")
839				if templ_7745c5c3_Err != nil {
840					return templ_7745c5c3_Err
841				}
842			}
843			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " ")
844			if templ_7745c5c3_Err != nil {
845				return templ_7745c5c3_Err
846			}
847			if p.MergeError != "" {
848				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, "<p class=\"d-err\" role=\"alert\">")
849				if templ_7745c5c3_Err != nil {
850					return templ_7745c5c3_Err
851				}
852				var templ_7745c5c3_Var43 string
853				templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergeError)
854				if templ_7745c5c3_Err != nil {
855					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 158, Col: 47}
856				}
857				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
858				if templ_7745c5c3_Err != nil {
859					return templ_7745c5c3_Err
860				}
861				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "</p>")
862				if templ_7745c5c3_Err != nil {
863					return templ_7745c5c3_Err
864				}
865			}
866			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, " ")
867			if templ_7745c5c3_Err != nil {
868				return templ_7745c5c3_Err
869			}
870			templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
871			if templ_7745c5c3_Err != nil {
872				return templ_7745c5c3_Err
873			}
874			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, " <div id=\"mr-refresh-status\" role=\"status\" aria-live=\"polite\"></div><div id=\"mr-range\"")
875			if templ_7745c5c3_Err != nil {
876				return templ_7745c5c3_Err
877			}
878			if p.Since == nil && p.SinceNote == "" {
879				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, " hidden")
880				if templ_7745c5c3_Err != nil {
881					return templ_7745c5c3_Err
882				}
883			}
884			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, ">")
885			if templ_7745c5c3_Err != nil {
886				return templ_7745c5c3_Err
887			}
888			if p.Since != nil {
889				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "<nav class=\"since\" aria-label=\"Diff range\"><a href=\"")
890				if templ_7745c5c3_Err != nil {
891					return templ_7745c5c3_Err
892				}
893				var templ_7745c5c3_Var44 templ.SafeURL
894				templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.AllHref))
895				if templ_7745c5c3_Err != nil {
896					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 166, Col: 43}
897				}
898				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
899				if templ_7745c5c3_Err != nil {
900					return templ_7745c5c3_Err
901				}
902				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, "\"")
903				if templ_7745c5c3_Err != nil {
904					return templ_7745c5c3_Err
905				}
906				if !p.Since.Current {
907					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, " aria-current=\"page\"")
908					if templ_7745c5c3_Err != nil {
909						return templ_7745c5c3_Err
910					}
911				}
912				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, ">all changes <span class=\"mute\">vs ")
913				if templ_7745c5c3_Err != nil {
914					return templ_7745c5c3_Err
915				}
916				var templ_7745c5c3_Var45 string
917				templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
918				if templ_7745c5c3_Err != nil {
919					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 170, Col: 50}
920				}
921				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var45))
922				if templ_7745c5c3_Err != nil {
923					return templ_7745c5c3_Err
924				}
925				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</span></a> <a href=\"")
926				if templ_7745c5c3_Err != nil {
927					return templ_7745c5c3_Err
928				}
929				var templ_7745c5c3_Var46 templ.SafeURL
930				templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.SinceHref))
931				if templ_7745c5c3_Err != nil {
932					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 172, Col: 45}
933				}
934				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var46))
935				if templ_7745c5c3_Err != nil {
936					return templ_7745c5c3_Err
937				}
938				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "\"")
939				if templ_7745c5c3_Err != nil {
940					return templ_7745c5c3_Err
941				}
942				if p.Since.Current {
943					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, " aria-current=\"page\"")
944					if templ_7745c5c3_Err != nil {
945						return templ_7745c5c3_Err
946					}
947				}
948				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, ">since your last read <span class=\"mute\">")
949				if templ_7745c5c3_Err != nil {
950					return templ_7745c5c3_Err
951				}
952				var templ_7745c5c3_Var47 string
953				templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.ReadShort)
954				if templ_7745c5c3_Err != nil {
955					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 176, Col: 65}
956				}
957				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var47))
958				if templ_7745c5c3_Err != nil {
959					return templ_7745c5c3_Err
960				}
961				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, " → ")
962				if templ_7745c5c3_Err != nil {
963					return templ_7745c5c3_Err
964				}
965				var templ_7745c5c3_Var48 string
966				templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.HeadShort)
967				if templ_7745c5c3_Err != nil {
968					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 176, Col: 91}
969				}
970				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
971				if templ_7745c5c3_Err != nil {
972					return templ_7745c5c3_Err
973				}
974				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, "</span></a></nav>")
975				if templ_7745c5c3_Err != nil {
976					return templ_7745c5c3_Err
977				}
978			}
979			if p.SinceNote != "" {
980				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, "<p class=\"notice\">")
981				if templ_7745c5c3_Err != nil {
982					return templ_7745c5c3_Err
983				}
984				var templ_7745c5c3_Var49 string
985				templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(p.SinceNote)
986				if templ_7745c5c3_Err != nil {
987					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 180, Col: 35}
988				}
989				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
990				if templ_7745c5c3_Err != nil {
991					return templ_7745c5c3_Err
992				}
993				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "</p>")
994				if templ_7745c5c3_Err != nil {
995					return templ_7745c5c3_Err
996				}
997			}
998			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "</div>")
999			if templ_7745c5c3_Err != nil {
1000				return templ_7745c5c3_Err
1001			}
1002			templ_7745c5c3_Err = mrBar(p).Render(ctx, templ_7745c5c3_Buffer)
1003			if templ_7745c5c3_Err != nil {
1004				return templ_7745c5c3_Err
1005			}
1006			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, " <div id=\"mr-diff-notices\"")
1007			if templ_7745c5c3_Err != nil {
1008				return templ_7745c5c3_Err
1009			}
1010			if !p.Invisible && p.Note == "" {
1011				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, " hidden")
1012				if templ_7745c5c3_Err != nil {
1013					return templ_7745c5c3_Err
1014				}
1015			}
1016			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, ">")
1017			if templ_7745c5c3_Err != nil {
1018				return templ_7745c5c3_Err
1019			}
1020			if p.Invisible {
1021				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
1022				if templ_7745c5c3_Err != nil {
1023					return templ_7745c5c3_Err
1024				}
1025			}
1026			if p.Note != "" {
1027				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, "<p class=\"notice\">")
1028				if templ_7745c5c3_Err != nil {
1029					return templ_7745c5c3_Err
1030				}
1031				var templ_7745c5c3_Var50 string
1032				templ_7745c5c3_Var50, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
1033				if templ_7745c5c3_Err != nil {
1034					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 192, Col: 30}
1035				}
1036				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var50))
1037				if templ_7745c5c3_Err != nil {
1038					return templ_7745c5c3_Err
1039				}
1040				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "</p>")
1041				if templ_7745c5c3_Err != nil {
1042					return templ_7745c5c3_Err
1043				}
1044			}
1045			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, "</div><div id=\"diffs\" data-mr")
1046			if templ_7745c5c3_Err != nil {
1047				return templ_7745c5c3_Err
1048			}
1049			if p.Canonical != "" {
1050				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, " data-canonical=\"")
1051				if templ_7745c5c3_Err != nil {
1052					return templ_7745c5c3_Err
1053				}
1054				var templ_7745c5c3_Var51 string
1055				templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Canonical)
1056				if templ_7745c5c3_Err != nil {
1057					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 199, Col: 32}
1058				}
1059				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var51)
1060				if templ_7745c5c3_Err != nil {
1061					return templ_7745c5c3_Err
1062				}
1063				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, "\"")
1064				if templ_7745c5c3_Err != nil {
1065					return templ_7745c5c3_Err
1066				}
1067			}
1068			if p.Both {
1069				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, " data-diff=\"")
1070				if templ_7745c5c3_Err != nil {
1071					return templ_7745c5c3_Err
1072				}
1073				var templ_7745c5c3_Var52 string
1074				templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
1075				if templ_7745c5c3_Err != nil {
1076					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 202, Col: 22}
1077				}
1078				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var52)
1079				if templ_7745c5c3_Err != nil {
1080					return templ_7745c5c3_Err
1081				}
1082				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "\"")
1083				if templ_7745c5c3_Err != nil {
1084					return templ_7745c5c3_Err
1085				}
1086			} else {
1087				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, " data-view=\"")
1088				if templ_7745c5c3_Err != nil {
1089					return templ_7745c5c3_Err
1090				}
1091				var templ_7745c5c3_Var53 string
1092				templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
1093				if templ_7745c5c3_Err != nil {
1094					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 204, Col: 22}
1095				}
1096				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var53)
1097				if templ_7745c5c3_Err != nil {
1098					return templ_7745c5c3_Err
1099				}
1100				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, "\"")
1101				if templ_7745c5c3_Err != nil {
1102					return templ_7745c5c3_Err
1103				}
1104			}
1105			if p.Both && !p.Pinned {
1106				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
1107				if templ_7745c5c3_Err != nil {
1108					return templ_7745c5c3_Err
1109				}
1110			}
1111			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, ">")
1112			if templ_7745c5c3_Err != nil {
1113				return templ_7745c5c3_Err
1114			}
1115			for _, f := range p.Files {
1116				templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
1117				if templ_7745c5c3_Err != nil {
1118					return templ_7745c5c3_Err
1119				}
1120			}
1121			if len(p.Files) == 0 {
1122				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "<p class=\"note\">no changed files.</p>")
1123				if templ_7745c5c3_Err != nil {
1124					return templ_7745c5c3_Err
1125				}
1126			}
1127			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "</div><div id=\"mr-comments\"><h2 class=\"rule-h\" id=\"comments\"><span>Comments</span><span class=\"count\">")
1128			if templ_7745c5c3_Err != nil {
1129				return templ_7745c5c3_Err
1130			}
1131			var templ_7745c5c3_Var54 string
1132			templ_7745c5c3_Var54, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NUnresolved))
1133			if templ_7745c5c3_Err != nil {
1134				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 218, Col: 97}
1135			}
1136			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var54))
1137			if templ_7745c5c3_Err != nil {
1138				return templ_7745c5c3_Err
1139			}
1140			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, " open / ")
1141			if templ_7745c5c3_Err != nil {
1142				return templ_7745c5c3_Err
1143			}
1144			var templ_7745c5c3_Var55 string
1145			templ_7745c5c3_Var55, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NComments))
1146			if templ_7745c5c3_Err != nil {
1147				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 218, Col: 126}
1148			}
1149			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var55))
1150			if templ_7745c5c3_Err != nil {
1151				return templ_7745c5c3_Err
1152			}
1153			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "</span></h2>")
1154			if templ_7745c5c3_Err != nil {
1155				return templ_7745c5c3_Err
1156			}
1157			for _, c := range p.Loose {
1158				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1159				if templ_7745c5c3_Err != nil {
1160					return templ_7745c5c3_Err
1161				}
1162			}
1163			for _, c := range p.General {
1164				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1165				if templ_7745c5c3_Err != nil {
1166					return templ_7745c5c3_Err
1167				}
1168			}
1169			if p.NComments == 0 {
1170				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "<p class=\"dim\">no comments yet.</p>")
1171				if templ_7745c5c3_Err != nil {
1172					return templ_7745c5c3_Err
1173				}
1174			}
1175			if p.GeneralForm != nil {
1176				templ_7745c5c3_Err = commentForm(*p.GeneralForm, "").Render(ctx, templ_7745c5c3_Buffer)
1177				if templ_7745c5c3_Err != nil {
1178					return templ_7745c5c3_Err
1179				}
1180			}
1181			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "</div>")
1182			if templ_7745c5c3_Err != nil {
1183				return templ_7745c5c3_Err
1184			}
1185			return nil
1186		})
1187		templ_7745c5c3_Err = Shell(l, mrRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer)
1188		if templ_7745c5c3_Err != nil {
1189			return templ_7745c5c3_Err
1190		}
1191		return nil
1192	})
1193}
1194
1195func branchLink(name, href string) templ.Component {
1196	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1197		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1198		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1199			return templ_7745c5c3_CtxErr
1200		}
1201		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1202		if !templ_7745c5c3_IsBuffer {
1203			defer func() {
1204				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1205				if templ_7745c5c3_Err == nil {
1206					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1207				}
1208			}()
1209		}
1210		ctx = templ.InitializeContext(ctx)
1211		templ_7745c5c3_Var56 := templ.GetChildren(ctx)
1212		if templ_7745c5c3_Var56 == nil {
1213			templ_7745c5c3_Var56 = templ.NopComponent
1214		}
1215		ctx = templ.ClearChildren(ctx)
1216		if href != "" {
1217			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "<a href=\"")
1218			if templ_7745c5c3_Err != nil {
1219				return templ_7745c5c3_Err
1220			}
1221			var templ_7745c5c3_Var57 templ.SafeURL
1222			templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(href))
1223			if templ_7745c5c3_Err != nil {
1224				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 237, Col: 31}
1225			}
1226			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var57))
1227			if templ_7745c5c3_Err != nil {
1228				return templ_7745c5c3_Err
1229			}
1230			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, "\">")
1231			if templ_7745c5c3_Err != nil {
1232				return templ_7745c5c3_Err
1233			}
1234			var templ_7745c5c3_Var58 string
1235			templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1236			if templ_7745c5c3_Err != nil {
1237				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 237, Col: 40}
1238			}
1239			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
1240			if templ_7745c5c3_Err != nil {
1241				return templ_7745c5c3_Err
1242			}
1243			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "</a>")
1244			if templ_7745c5c3_Err != nil {
1245				return templ_7745c5c3_Err
1246			}
1247		} else {
1248			var templ_7745c5c3_Var59 string
1249			templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1250			if templ_7745c5c3_Err != nil {
1251				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 239, Col: 8}
1252			}
1253			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
1254			if templ_7745c5c3_Err != nil {
1255				return templ_7745c5c3_Err
1256			}
1257		}
1258		return nil
1259	})
1260}
1261
1262// lineNotes are the comments under a line of the diff, and the form to write
1263// one when the reader asked for it. The diff is in the page twice (unified and
1264// split); the suffix keeps the ids unique, the unified table having none.
1265func lineNotes(notes []CommentView, form *CommentForm, suffix string) templ.Component {
1266	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1267		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1268		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1269			return templ_7745c5c3_CtxErr
1270		}
1271		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1272		if !templ_7745c5c3_IsBuffer {
1273			defer func() {
1274				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1275				if templ_7745c5c3_Err == nil {
1276					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1277				}
1278			}()
1279		}
1280		ctx = templ.InitializeContext(ctx)
1281		templ_7745c5c3_Var60 := templ.GetChildren(ctx)
1282		if templ_7745c5c3_Var60 == nil {
1283			templ_7745c5c3_Var60 = templ.NopComponent
1284		}
1285		ctx = templ.ClearChildren(ctx)
1286		for _, c := range notes {
1287			templ_7745c5c3_Err = commentView(c, suffix).Render(ctx, templ_7745c5c3_Buffer)
1288			if templ_7745c5c3_Err != nil {
1289				return templ_7745c5c3_Err
1290			}
1291		}
1292		if form != nil {
1293			templ_7745c5c3_Err = commentForm(*form, suffix).Render(ctx, templ_7745c5c3_Buffer)
1294			if templ_7745c5c3_Err != nil {
1295				return templ_7745c5c3_Err
1296			}
1297		}
1298		return nil
1299	})
1300}
1301
1302// commentView is a note: a ruled block, under its line in the diff or in the
1303// list of comments. Body comes only from the safe Markdown renderer.
1304func commentView(c CommentView, suffix string) templ.Component {
1305	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1306		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1307		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1308			return templ_7745c5c3_CtxErr
1309		}
1310		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1311		if !templ_7745c5c3_IsBuffer {
1312			defer func() {
1313				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1314				if templ_7745c5c3_Err == nil {
1315					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1316				}
1317			}()
1318		}
1319		ctx = templ.InitializeContext(ctx)
1320		templ_7745c5c3_Var61 := templ.GetChildren(ctx)
1321		if templ_7745c5c3_Var61 == nil {
1322			templ_7745c5c3_Var61 = templ.NopComponent
1323		}
1324		ctx = templ.ClearChildren(ctx)
1325		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "<div class=\"cmt\" id=\"")
1326		if templ_7745c5c3_Err != nil {
1327			return templ_7745c5c3_Err
1328		}
1329		var templ_7745c5c3_Var62 string
1330		templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.ResolveAttributeValue("c" + c.ID + suffix)
1331		if templ_7745c5c3_Err != nil {
1332			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 258, Col: 42}
1333		}
1334		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var62)
1335		if templ_7745c5c3_Err != nil {
1336			return templ_7745c5c3_Err
1337		}
1338		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "\" data-resolved=\"")
1339		if templ_7745c5c3_Err != nil {
1340			return templ_7745c5c3_Err
1341		}
1342		var templ_7745c5c3_Var63 string
1343		templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolved))
1344		if templ_7745c5c3_Err != nil {
1345			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 258, Col: 81}
1346		}
1347		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var63)
1348		if templ_7745c5c3_Err != nil {
1349			return templ_7745c5c3_Err
1350		}
1351		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "\"")
1352		if templ_7745c5c3_Err != nil {
1353			return templ_7745c5c3_Err
1354		}
1355		if c.Reply != nil {
1356			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, " data-thread")
1357			if templ_7745c5c3_Err != nil {
1358				return templ_7745c5c3_Err
1359			}
1360		}
1361		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "><p class=\"c-head\"><span class=\"c-who\">")
1362		if templ_7745c5c3_Err != nil {
1363			return templ_7745c5c3_Err
1364		}
1365		var templ_7745c5c3_Var64 string
1366		templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
1367		if templ_7745c5c3_Err != nil {
1368			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 260, Col: 33}
1369		}
1370		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
1371		if templ_7745c5c3_Err != nil {
1372			return templ_7745c5c3_Err
1373		}
1374		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "</span> ")
1375		if templ_7745c5c3_Err != nil {
1376			return templ_7745c5c3_Err
1377		}
1378		if c.WhenAt != "" {
1379			var templ_7745c5c3_Var65 string
1380			templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1381			if templ_7745c5c3_Err != nil {
1382				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 262, Col: 9}
1383			}
1384			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
1385			if templ_7745c5c3_Err != nil {
1386				return templ_7745c5c3_Err
1387			}
1388			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "<time class=\"mute\" datetime=\"")
1389			if templ_7745c5c3_Err != nil {
1390				return templ_7745c5c3_Err
1391			}
1392			var templ_7745c5c3_Var66 string
1393			templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
1394			if templ_7745c5c3_Err != nil {
1395				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 262, Col: 49}
1396			}
1397			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var66)
1398			if templ_7745c5c3_Err != nil {
1399				return templ_7745c5c3_Err
1400			}
1401			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "\" title=\"")
1402			if templ_7745c5c3_Err != nil {
1403				return templ_7745c5c3_Err
1404			}
1405			var templ_7745c5c3_Var67 string
1406			templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Abs)
1407			if templ_7745c5c3_Err != nil {
1408				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 262, Col: 65}
1409			}
1410			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var67)
1411			if templ_7745c5c3_Err != nil {
1412				return templ_7745c5c3_Err
1413			}
1414			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "\">")
1415			if templ_7745c5c3_Err != nil {
1416				return templ_7745c5c3_Err
1417			}
1418			var templ_7745c5c3_Var68 string
1419			templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
1420			if templ_7745c5c3_Err != nil {
1421				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 262, Col: 76}
1422			}
1423			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
1424			if templ_7745c5c3_Err != nil {
1425				return templ_7745c5c3_Err
1426			}
1427			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "</time> ")
1428			if templ_7745c5c3_Err != nil {
1429				return templ_7745c5c3_Err
1430			}
1431		}
1432		if c.Resolved {
1433			var templ_7745c5c3_Var69 string
1434			templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1435			if templ_7745c5c3_Err != nil {
1436				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 265, Col: 9}
1437			}
1438			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var69))
1439			if templ_7745c5c3_Err != nil {
1440				return templ_7745c5c3_Err
1441			}
1442			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "<span class=\"c-state\">resolved</span> ")
1443			if templ_7745c5c3_Err != nil {
1444				return templ_7745c5c3_Err
1445			}
1446		}
1447		if c.Outdated {
1448			var templ_7745c5c3_Var70 string
1449			templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1450			if templ_7745c5c3_Err != nil {
1451				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 268, Col: 9}
1452			}
1453			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
1454			if templ_7745c5c3_Err != nil {
1455				return templ_7745c5c3_Err
1456			}
1457			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "<span class=\"c-state\" title=\"written on an earlier head; the line may have moved\">outdated</span> ")
1458			if templ_7745c5c3_Err != nil {
1459				return templ_7745c5c3_Err
1460			}
1461		}
1462		if c.Where != "" {
1463			var templ_7745c5c3_Var71 string
1464			templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1465			if templ_7745c5c3_Err != nil {
1466				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 271, Col: 9}
1467			}
1468			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var71))
1469			if templ_7745c5c3_Err != nil {
1470				return templ_7745c5c3_Err
1471			}
1472			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<span class=\"c-where mute\">")
1473			if templ_7745c5c3_Err != nil {
1474				return templ_7745c5c3_Err
1475			}
1476			var templ_7745c5c3_Var72 string
1477			templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(c.Where)
1478			if templ_7745c5c3_Err != nil {
1479				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 271, Col: 47}
1480			}
1481			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
1482			if templ_7745c5c3_Err != nil {
1483				return templ_7745c5c3_Err
1484			}
1485			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "</span>")
1486			if templ_7745c5c3_Err != nil {
1487				return templ_7745c5c3_Err
1488			}
1489		}
1490		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "</p>")
1491		if templ_7745c5c3_Err != nil {
1492			return templ_7745c5c3_Err
1493		}
1494		if len(c.Parts) > 0 {
1495			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "<p class=\"c-text\">")
1496			if templ_7745c5c3_Err != nil {
1497				return templ_7745c5c3_Err
1498			}
1499			templ_7745c5c3_Err = userText(c.Parts).Render(ctx, templ_7745c5c3_Buffer)
1500			if templ_7745c5c3_Err != nil {
1501				return templ_7745c5c3_Err
1502			}
1503			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "</p>")
1504			if templ_7745c5c3_Err != nil {
1505				return templ_7745c5c3_Err
1506			}
1507		} else if c.Deleted {
1508			if c.Verdict != "" {
1509				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "<p class=\"mute\">text deleted</p>")
1510				if templ_7745c5c3_Err != nil {
1511					return templ_7745c5c3_Err
1512				}
1513			} else {
1514				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "<p class=\"mute\">deleted note</p>")
1515				if templ_7745c5c3_Err != nil {
1516					return templ_7745c5c3_Err
1517				}
1518			}
1519		} else {
1520			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "<div class=\"c-body prose\">")
1521			if templ_7745c5c3_Err != nil {
1522				return templ_7745c5c3_Err
1523			}
1524			if suffix == "-s" {
1525				templ_7745c5c3_Err = templ.Raw(string(c.BodySplit)).Render(ctx, templ_7745c5c3_Buffer)
1526				if templ_7745c5c3_Err != nil {
1527					return templ_7745c5c3_Err
1528				}
1529			} else {
1530				templ_7745c5c3_Err = templ.Raw(string(c.Body)).Render(ctx, templ_7745c5c3_Buffer)
1531				if templ_7745c5c3_Err != nil {
1532					return templ_7745c5c3_Err
1533				}
1534			}
1535			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "</div>")
1536			if templ_7745c5c3_Err != nil {
1537				return templ_7745c5c3_Err
1538			}
1539		}
1540		if c.Edited {
1541			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "<span class=\"mute\">edited</span> ")
1542			if templ_7745c5c3_Err != nil {
1543				return templ_7745c5c3_Err
1544			}
1545		}
1546		if c.Verdict != "" {
1547			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "<span class=\"c-state\">")
1548			if templ_7745c5c3_Err != nil {
1549				return templ_7745c5c3_Err
1550			}
1551			var templ_7745c5c3_Var73 string
1552			templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinStringErrs(c.Verdict)
1553			if templ_7745c5c3_Err != nil {
1554				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 295, Col: 36}
1555			}
1556			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var73))
1557			if templ_7745c5c3_Err != nil {
1558				return templ_7745c5c3_Err
1559			}
1560			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "</span> ")
1561			if templ_7745c5c3_Err != nil {
1562				return templ_7745c5c3_Err
1563			}
1564		}
1565		if c.Range != "" {
1566			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "<span class=\"mute\">")
1567			if templ_7745c5c3_Err != nil {
1568				return templ_7745c5c3_Err
1569			}
1570			var templ_7745c5c3_Var74 string
1571			templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.JoinStringErrs(c.Range)
1572			if templ_7745c5c3_Err != nil {
1573				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 298, Col: 31}
1574			}
1575			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var74))
1576			if templ_7745c5c3_Err != nil {
1577				return templ_7745c5c3_Err
1578			}
1579			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "</span> ")
1580			if templ_7745c5c3_Err != nil {
1581				return templ_7745c5c3_Err
1582			}
1583		}
1584		if c.Quote != "" {
1585			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "<button type=\"button\" class=\"btn\" data-js data-quote=\"")
1586			if templ_7745c5c3_Err != nil {
1587				return templ_7745c5c3_Err
1588			}
1589			var templ_7745c5c3_Var75 string
1590			templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Quote)
1591			if templ_7745c5c3_Err != nil {
1592				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 301, Col: 65}
1593			}
1594			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var75)
1595			if templ_7745c5c3_Err != nil {
1596				return templ_7745c5c3_Err
1597			}
1598			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "\">Quote</button> ")
1599			if templ_7745c5c3_Err != nil {
1600				return templ_7745c5c3_Err
1601			}
1602		}
1603		if c.Edit != nil {
1604			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "<details><summary>Edit</summary><form method=\"post\" action=\"")
1605			if templ_7745c5c3_Err != nil {
1606				return templ_7745c5c3_Err
1607			}
1608			var templ_7745c5c3_Var76 templ.SafeURL
1609			templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Edit.Action))
1610			if templ_7745c5c3_Err != nil {
1611				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 304, Col: 92}
1612			}
1613			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var76))
1614			if templ_7745c5c3_Err != nil {
1615				return templ_7745c5c3_Err
1616			}
1617			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "\"><input type=\"hidden\" name=\"from\" value=\"")
1618			if templ_7745c5c3_Err != nil {
1619				return templ_7745c5c3_Err
1620			}
1621			var templ_7745c5c3_Var77 string
1622			templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Edit.From))
1623			if templ_7745c5c3_Err != nil {
1624				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 304, Col: 153}
1625			}
1626			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var77)
1627			if templ_7745c5c3_Err != nil {
1628				return templ_7745c5c3_Err
1629			}
1630			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "\"><textarea name=\"text\" maxlength=\"8000\">")
1631			if templ_7745c5c3_Err != nil {
1632				return templ_7745c5c3_Err
1633			}
1634			var templ_7745c5c3_Var78 string
1635			templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(c.Edit.Text)
1636			if templ_7745c5c3_Err != nil {
1637				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 304, Col: 209}
1638			}
1639			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
1640			if templ_7745c5c3_Err != nil {
1641				return templ_7745c5c3_Err
1642			}
1643			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "</textarea><button class=\"btn\" type=\"submit\">Save</button></form></details> ")
1644			if templ_7745c5c3_Err != nil {
1645				return templ_7745c5c3_Err
1646			}
1647		}
1648		if c.Delete != nil {
1649			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "<details><summary>Delete</summary><form method=\"post\" action=\"")
1650			if templ_7745c5c3_Err != nil {
1651				return templ_7745c5c3_Err
1652			}
1653			var templ_7745c5c3_Var79 templ.SafeURL
1654			templ_7745c5c3_Var79, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Delete.Action))
1655			if templ_7745c5c3_Err != nil {
1656				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 307, Col: 96}
1657			}
1658			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var79))
1659			if templ_7745c5c3_Err != nil {
1660				return templ_7745c5c3_Err
1661			}
1662			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "\"><input type=\"hidden\" name=\"from\" value=\"")
1663			if templ_7745c5c3_Err != nil {
1664				return templ_7745c5c3_Err
1665			}
1666			var templ_7745c5c3_Var80 string
1667			templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Delete.From))
1668			if templ_7745c5c3_Err != nil {
1669				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 307, Col: 159}
1670			}
1671			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var80)
1672			if templ_7745c5c3_Err != nil {
1673				return templ_7745c5c3_Err
1674			}
1675			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "\"><p>Delete this note?</p><button class=\"btn\" type=\"submit\">Confirm delete</button></form></details> ")
1676			if templ_7745c5c3_Err != nil {
1677				return templ_7745c5c3_Err
1678			}
1679		}
1680		for _, reply := range c.Replies {
1681			templ_7745c5c3_Err = commentView(reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1682			if templ_7745c5c3_Err != nil {
1683				return templ_7745c5c3_Err
1684			}
1685		}
1686		if c.Reply != nil {
1687			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "<details data-reply><summary>Reply</summary>")
1688			if templ_7745c5c3_Err != nil {
1689				return templ_7745c5c3_Err
1690			}
1691			templ_7745c5c3_Err = commentForm(*c.Reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1692			if templ_7745c5c3_Err != nil {
1693				return templ_7745c5c3_Err
1694			}
1695			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "</details> ")
1696			if templ_7745c5c3_Err != nil {
1697				return templ_7745c5c3_Err
1698			}
1699		}
1700		if c.Resolve != nil {
1701			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "<form class=\"c-act\" method=\"post\" action=\"")
1702			if templ_7745c5c3_Err != nil {
1703				return templ_7745c5c3_Err
1704			}
1705			var templ_7745c5c3_Var81 templ.SafeURL
1706			templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Resolve.Action))
1707			if templ_7745c5c3_Err != nil {
1708				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 318, Col: 77}
1709			}
1710			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var81))
1711			if templ_7745c5c3_Err != nil {
1712				return templ_7745c5c3_Err
1713			}
1714			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "\"><input type=\"hidden\" name=\"resolved\" value=\"")
1715			if templ_7745c5c3_Err != nil {
1716				return templ_7745c5c3_Err
1717			}
1718			var templ_7745c5c3_Var82 string
1719			templ_7745c5c3_Var82, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolve.Value))
1720			if templ_7745c5c3_Err != nil {
1721				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 319, Col: 74}
1722			}
1723			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var82)
1724			if templ_7745c5c3_Err != nil {
1725				return templ_7745c5c3_Err
1726			}
1727			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "\"> ")
1728			if templ_7745c5c3_Err != nil {
1729				return templ_7745c5c3_Err
1730			}
1731			if c.Resolve.From > 0 {
1732				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "<input type=\"hidden\" name=\"from\" value=\"")
1733				if templ_7745c5c3_Err != nil {
1734					return templ_7745c5c3_Err
1735				}
1736				var templ_7745c5c3_Var83 string
1737				templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Resolve.From))
1738				if templ_7745c5c3_Err != nil {
1739					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 321, Col: 66}
1740				}
1741				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var83)
1742				if templ_7745c5c3_Err != nil {
1743					return templ_7745c5c3_Err
1744				}
1745				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "\"> ")
1746				if templ_7745c5c3_Err != nil {
1747					return templ_7745c5c3_Err
1748				}
1749			}
1750			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "<button type=\"submit\" class=\"btn\">")
1751			if templ_7745c5c3_Err != nil {
1752				return templ_7745c5c3_Err
1753			}
1754			var templ_7745c5c3_Var84 string
1755			templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.JoinStringErrs(c.Resolve.Label)
1756			if templ_7745c5c3_Err != nil {
1757				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 323, Col: 55}
1758			}
1759			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var84))
1760			if templ_7745c5c3_Err != nil {
1761				return templ_7745c5c3_Err
1762			}
1763			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "</button></form>")
1764			if templ_7745c5c3_Err != nil {
1765				return templ_7745c5c3_Err
1766			}
1767		}
1768		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "</div>")
1769		if templ_7745c5c3_Err != nil {
1770			return templ_7745c5c3_Err
1771		}
1772		return nil
1773	})
1774}
1775
1776func boolText(b bool) string {
1777	if b {
1778		return "true"
1779	}
1780	return "false"
1781}
1782
1783// commentForm writes a comment, general or on a line.
1784func commentForm(f CommentForm, suffix string) templ.Component {
1785	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1786		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1787		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1788			return templ_7745c5c3_CtxErr
1789		}
1790		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1791		if !templ_7745c5c3_IsBuffer {
1792			defer func() {
1793				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1794				if templ_7745c5c3_Err == nil {
1795					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1796				}
1797			}()
1798		}
1799		ctx = templ.InitializeContext(ctx)
1800		templ_7745c5c3_Var85 := templ.GetChildren(ctx)
1801		if templ_7745c5c3_Var85 == nil {
1802			templ_7745c5c3_Var85 = templ.NopComponent
1803		}
1804		ctx = templ.ClearChildren(ctx)
1805		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, "<form class=\"cform\" method=\"post\" action=\"")
1806		if templ_7745c5c3_Err != nil {
1807			return templ_7745c5c3_Err
1808		}
1809		var templ_7745c5c3_Var86 templ.SafeURL
1810		templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Action))
1811		if templ_7745c5c3_Err != nil {
1812			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 338, Col: 67}
1813		}
1814		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var86))
1815		if templ_7745c5c3_Err != nil {
1816			return templ_7745c5c3_Err
1817		}
1818		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, "\"><label for=\"")
1819		if templ_7745c5c3_Err != nil {
1820			return templ_7745c5c3_Err
1821		}
1822		var templ_7745c5c3_Var87 string
1823		templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1824		if templ_7745c5c3_Err != nil {
1825			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 339, Col: 28}
1826		}
1827		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
1828		if templ_7745c5c3_Err != nil {
1829			return templ_7745c5c3_Err
1830		}
1831		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, "\">")
1832		if templ_7745c5c3_Err != nil {
1833			return templ_7745c5c3_Err
1834		}
1835		var templ_7745c5c3_Var88 string
1836		templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.JoinStringErrs(f.Title)
1837		if templ_7745c5c3_Err != nil {
1838			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 339, Col: 40}
1839		}
1840		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var88))
1841		if templ_7745c5c3_Err != nil {
1842			return templ_7745c5c3_Err
1843		}
1844		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "</label> <textarea id=\"")
1845		if templ_7745c5c3_Err != nil {
1846			return templ_7745c5c3_Err
1847		}
1848		var templ_7745c5c3_Var89 string
1849		templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1850		if templ_7745c5c3_Err != nil {
1851			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 341, Col: 21}
1852		}
1853		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var89)
1854		if templ_7745c5c3_Err != nil {
1855			return templ_7745c5c3_Err
1856		}
1857		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "\" name=\"text\" rows=\"3\" maxlength=\"8000\"")
1858		if templ_7745c5c3_Err != nil {
1859			return templ_7745c5c3_Err
1860		}
1861		if f.Plain {
1862			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, " required placeholder=\"plain text, 8000 characters at most\"")
1863			if templ_7745c5c3_Err != nil {
1864				return templ_7745c5c3_Err
1865			}
1866		} else {
1867			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, " placeholder=\"Markdown, 8000 characters at most\"")
1868			if templ_7745c5c3_Err != nil {
1869				return templ_7745c5c3_Err
1870			}
1871		}
1872		if f.Focus {
1873			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, " autofocus")
1874			if templ_7745c5c3_Err != nil {
1875				return templ_7745c5c3_Err
1876			}
1877		}
1878		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "></textarea> ")
1879		if templ_7745c5c3_Err != nil {
1880			return templ_7745c5c3_Err
1881		}
1882		if f.Path != "" {
1883			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "<input type=\"hidden\" name=\"path\" value=\"")
1884			if templ_7745c5c3_Err != nil {
1885				return templ_7745c5c3_Err
1886			}
1887			var templ_7745c5c3_Var90 string
1888			templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Path)
1889			if templ_7745c5c3_Err != nil {
1890				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 356, Col: 50}
1891			}
1892			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var90)
1893			if templ_7745c5c3_Err != nil {
1894				return templ_7745c5c3_Err
1895			}
1896			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "\"> <input type=\"hidden\" name=\"line\" value=\"")
1897			if templ_7745c5c3_Err != nil {
1898				return templ_7745c5c3_Err
1899			}
1900			var templ_7745c5c3_Var91 string
1901			templ_7745c5c3_Var91, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Line)
1902			if templ_7745c5c3_Err != nil {
1903				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 357, Col: 50}
1904			}
1905			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var91)
1906			if templ_7745c5c3_Err != nil {
1907				return templ_7745c5c3_Err
1908			}
1909			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "\"> <input type=\"hidden\" name=\"side\" value=\"")
1910			if templ_7745c5c3_Err != nil {
1911				return templ_7745c5c3_Err
1912			}
1913			var templ_7745c5c3_Var92 string
1914			templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Side)
1915			if templ_7745c5c3_Err != nil {
1916				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 358, Col: 50}
1917			}
1918			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var92)
1919			if templ_7745c5c3_Err != nil {
1920				return templ_7745c5c3_Err
1921			}
1922			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "\"> <label>from line <input type=\"number\" name=\"start_line\" min=\"1\" value=\"")
1923			if templ_7745c5c3_Err != nil {
1924				return templ_7745c5c3_Err
1925			}
1926			var templ_7745c5c3_Var93 string
1927			templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.StartLine)
1928			if templ_7745c5c3_Err != nil {
1929				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 359, Col: 86}
1930			}
1931			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var93)
1932			if templ_7745c5c3_Err != nil {
1933				return templ_7745c5c3_Err
1934			}
1935			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "\"></label> ")
1936			if templ_7745c5c3_Err != nil {
1937				return templ_7745c5c3_Err
1938			}
1939		}
1940		if f.ReplyTo != "" {
1941			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "<input type=\"hidden\" name=\"reply_to\" value=\"")
1942			if templ_7745c5c3_Err != nil {
1943				return templ_7745c5c3_Err
1944			}
1945			var templ_7745c5c3_Var94 string
1946			templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ReplyTo)
1947			if templ_7745c5c3_Err != nil {
1948				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 362, Col: 57}
1949			}
1950			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var94)
1951			if templ_7745c5c3_Err != nil {
1952				return templ_7745c5c3_Err
1953			}
1954			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "\"> ")
1955			if templ_7745c5c3_Err != nil {
1956				return templ_7745c5c3_Err
1957			}
1958		}
1959		if f.Path == "" && f.ReplyTo == "" && !f.Plain {
1960			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "<fieldset><legend>Verdict</legend><label><input type=\"radio\" name=\"verdict\" value=\"\" checked>Note</label><label><input type=\"radio\" name=\"verdict\" value=\"approve\">Approve</label><label><input type=\"radio\" name=\"verdict\" value=\"changes_requested\">Request changes</label></fieldset>")
1961			if templ_7745c5c3_Err != nil {
1962				return templ_7745c5c3_Err
1963			}
1964		}
1965		if f.From > 0 {
1966			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "<input type=\"hidden\" name=\"from\" value=\"")
1967			if templ_7745c5c3_Err != nil {
1968				return templ_7745c5c3_Err
1969			}
1970			var templ_7745c5c3_Var95 string
1971			templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(f.From))
1972			if templ_7745c5c3_Err != nil {
1973				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 368, Col: 56}
1974			}
1975			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var95)
1976			if templ_7745c5c3_Err != nil {
1977				return templ_7745c5c3_Err
1978			}
1979			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "\">")
1980			if templ_7745c5c3_Err != nil {
1981				return templ_7745c5c3_Err
1982			}
1983		}
1984		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "<div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Comment</button> ")
1985		if templ_7745c5c3_Err != nil {
1986			return templ_7745c5c3_Err
1987		}
1988		if f.Cancel != "" {
1989			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, "<a class=\"btn\" href=\"")
1990			if templ_7745c5c3_Err != nil {
1991				return templ_7745c5c3_Err
1992			}
1993			var templ_7745c5c3_Var96 templ.SafeURL
1994			templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Cancel))
1995			if templ_7745c5c3_Err != nil {
1996				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 373, Col: 49}
1997			}
1998			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
1999			if templ_7745c5c3_Err != nil {
2000				return templ_7745c5c3_Err
2001			}
2002			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "\">Cancel</a>")
2003			if templ_7745c5c3_Err != nil {
2004				return templ_7745c5c3_Err
2005			}
2006		}
2007		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "</div></form>")
2008		if templ_7745c5c3_Err != nil {
2009			return templ_7745c5c3_Err
2010		}
2011		return nil
2012	})
2013}
2014
2015func mrFooter(p MRPage) templ.Component {
2016	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2017		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2018		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2019			return templ_7745c5c3_CtxErr
2020		}
2021		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2022		if !templ_7745c5c3_IsBuffer {
2023			defer func() {
2024				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2025				if templ_7745c5c3_Err == nil {
2026					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2027				}
2028			}()
2029		}
2030		ctx = templ.InitializeContext(ctx)
2031		templ_7745c5c3_Var97 := templ.GetChildren(ctx)
2032		if templ_7745c5c3_Var97 == nil {
2033			templ_7745c5c3_Var97 = templ.NopComponent
2034		}
2035		ctx = templ.ClearChildren(ctx)
2036		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "<footer class=\"mr-footer\"><nav data-mr-tabs aria-label=\"Branch details\"><a id=\"mr-tab-commits\" href=\"#mr-commits\">Commits <span class=\"count\">")
2037		if templ_7745c5c3_Err != nil {
2038			return templ_7745c5c3_Err
2039		}
2040		var templ_7745c5c3_Var98 string
2041		templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitCount)
2042		if templ_7745c5c3_Err != nil {
2043			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 382, Col: 88}
2044		}
2045		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
2046		if templ_7745c5c3_Err != nil {
2047			return templ_7745c5c3_Err
2048		}
2049		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, "</span></a> <a id=\"mr-tab-checks\" href=\"#mr-checks\">")
2050		if templ_7745c5c3_Err != nil {
2051			return templ_7745c5c3_Err
2052		}
2053		var templ_7745c5c3_Var99 string
2054		templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.JoinStringErrs("Checks ")
2055		if templ_7745c5c3_Err != nil {
2056			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 384, Col: 15}
2057		}
2058		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var99))
2059		if templ_7745c5c3_Err != nil {
2060			return templ_7745c5c3_Err
2061		}
2062		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, " <span data-checks-label>")
2063		if templ_7745c5c3_Err != nil {
2064			return templ_7745c5c3_Err
2065		}
2066		if p.ChecksSum.Total > 0 {
2067			var templ_7745c5c3_Var100 string
2068			templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(p.ChecksSum.Title)
2069			if templ_7745c5c3_Err != nil {
2070				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 387, Col: 25}
2071			}
2072			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2073			if templ_7745c5c3_Err != nil {
2074				return templ_7745c5c3_Err
2075			}
2076		} else {
2077			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "no checks")
2078			if templ_7745c5c3_Err != nil {
2079				return templ_7745c5c3_Err
2080			}
2081		}
2082		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "</span></a></nav><div id=\"mr-commits\" data-mr-panel role=\"region\" aria-labelledby=\"mr-tab-commits\"><table class=\"mr-commits\"><thead><tr><th>Commit</th><th>Subject</th><th>Author</th><th>Date</th><th>Signature</th><th>Status</th></tr></thead> <tbody>")
2083		if templ_7745c5c3_Err != nil {
2084			return templ_7745c5c3_Err
2085		}
2086		for _, c := range p.Commits {
2087			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "<tr")
2088			if templ_7745c5c3_Err != nil {
2089				return templ_7745c5c3_Err
2090			}
2091			if c.New {
2092				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, " data-new")
2093				if templ_7745c5c3_Err != nil {
2094					return templ_7745c5c3_Err
2095				}
2096			}
2097			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "><td><a href=\"")
2098			if templ_7745c5c3_Err != nil {
2099				return templ_7745c5c3_Err
2100			}
2101			var templ_7745c5c3_Var101 templ.SafeURL
2102			templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2103			if templ_7745c5c3_Err != nil {
2104				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 42}
2105			}
2106			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
2107			if templ_7745c5c3_Err != nil {
2108				return templ_7745c5c3_Err
2109			}
2110			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "\">")
2111			if templ_7745c5c3_Err != nil {
2112				return templ_7745c5c3_Err
2113			}
2114			var templ_7745c5c3_Var102 string
2115			templ_7745c5c3_Var102, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2116			if templ_7745c5c3_Err != nil {
2117				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 54}
2118			}
2119			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var102))
2120			if templ_7745c5c3_Err != nil {
2121				return templ_7745c5c3_Err
2122			}
2123			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "</a></td><td>")
2124			if templ_7745c5c3_Err != nil {
2125				return templ_7745c5c3_Err
2126			}
2127			var templ_7745c5c3_Var103 string
2128			templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
2129			if templ_7745c5c3_Err != nil {
2130				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 401, Col: 22}
2131			}
2132			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
2133			if templ_7745c5c3_Err != nil {
2134				return templ_7745c5c3_Err
2135			}
2136			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "</td><td>")
2137			if templ_7745c5c3_Err != nil {
2138				return templ_7745c5c3_Err
2139			}
2140			var templ_7745c5c3_Var104 string
2141			templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
2142			if templ_7745c5c3_Err != nil {
2143				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 402, Col: 21}
2144			}
2145			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
2146			if templ_7745c5c3_Err != nil {
2147				return templ_7745c5c3_Err
2148			}
2149			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "</td><td>")
2150			if templ_7745c5c3_Err != nil {
2151				return templ_7745c5c3_Err
2152			}
2153			if c.WhenAt != "" {
2154				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "<time datetime=\"")
2155				if templ_7745c5c3_Err != nil {
2156					return templ_7745c5c3_Err
2157				}
2158				var templ_7745c5c3_Var105 string
2159				templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2160				if templ_7745c5c3_Err != nil {
2161					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 405, Col: 34}
2162				}
2163				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var105)
2164				if templ_7745c5c3_Err != nil {
2165					return templ_7745c5c3_Err
2166				}
2167				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "\">")
2168				if templ_7745c5c3_Err != nil {
2169					return templ_7745c5c3_Err
2170				}
2171				var templ_7745c5c3_Var106 string
2172				templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
2173				if templ_7745c5c3_Err != nil {
2174					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 405, Col: 45}
2175				}
2176				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106))
2177				if templ_7745c5c3_Err != nil {
2178					return templ_7745c5c3_Err
2179				}
2180				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</time>")
2181				if templ_7745c5c3_Err != nil {
2182					return templ_7745c5c3_Err
2183				}
2184			}
2185			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "</td><td>")
2186			if templ_7745c5c3_Err != nil {
2187				return templ_7745c5c3_Err
2188			}
2189			if c.Sig != nil {
2190				templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
2191				if templ_7745c5c3_Err != nil {
2192					return templ_7745c5c3_Err
2193				}
2194			}
2195			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "</td><td>")
2196			if templ_7745c5c3_Err != nil {
2197				return templ_7745c5c3_Err
2198			}
2199			if c.New {
2200				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "<span>new</span>")
2201				if templ_7745c5c3_Err != nil {
2202					return templ_7745c5c3_Err
2203				}
2204			}
2205			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "</td></tr>")
2206			if templ_7745c5c3_Err != nil {
2207				return templ_7745c5c3_Err
2208			}
2209		}
2210		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</tbody></table>")
2211		if templ_7745c5c3_Err != nil {
2212			return templ_7745c5c3_Err
2213		}
2214		if len(p.Commits) == 0 {
2215			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "<p class=\"dim\">no commit to merge.</p>")
2216			if templ_7745c5c3_Err != nil {
2217				return templ_7745c5c3_Err
2218			}
2219		}
2220		if p.CommitsNote != "" {
2221			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "<p class=\"note\">")
2222			if templ_7745c5c3_Err != nil {
2223				return templ_7745c5c3_Err
2224			}
2225			var templ_7745c5c3_Var107 string
2226			templ_7745c5c3_Var107, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
2227			if templ_7745c5c3_Err != nil {
2228				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 426, Col: 35}
2229			}
2230			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var107))
2231			if templ_7745c5c3_Err != nil {
2232				return templ_7745c5c3_Err
2233			}
2234			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "</p>")
2235			if templ_7745c5c3_Err != nil {
2236				return templ_7745c5c3_Err
2237			}
2238		}
2239		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "</div><div id=\"mr-checks-panel\" data-mr-panel role=\"region\" aria-labelledby=\"mr-tab-checks\">")
2240		if templ_7745c5c3_Err != nil {
2241			return templ_7745c5c3_Err
2242		}
2243		templ_7745c5c3_Err = MRChecks(p.Checks).Render(ctx, templ_7745c5c3_Buffer)
2244		if templ_7745c5c3_Err != nil {
2245			return templ_7745c5c3_Err
2246		}
2247		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "</div></footer>")
2248		if templ_7745c5c3_Err != nil {
2249			return templ_7745c5c3_Err
2250		}
2251		return nil
2252	})
2253}
2254
2255func mrRail(p MRPage) templ.Component {
2256	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2257		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2258		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2259			return templ_7745c5c3_CtxErr
2260		}
2261		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2262		if !templ_7745c5c3_IsBuffer {
2263			defer func() {
2264				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2265				if templ_7745c5c3_Err == nil {
2266					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2267				}
2268			}()
2269		}
2270		ctx = templ.InitializeContext(ctx)
2271		templ_7745c5c3_Var108 := templ.GetChildren(ctx)
2272		if templ_7745c5c3_Var108 == nil {
2273			templ_7745c5c3_Var108 = templ.NopComponent
2274		}
2275		ctx = templ.ClearChildren(ctx)
2276		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "<section aria-labelledby=\"r-files\" class=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
2277		if templ_7745c5c3_Err != nil {
2278			return templ_7745c5c3_Err
2279		}
2280		var templ_7745c5c3_Var109 string
2281		templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
2282		if templ_7745c5c3_Err != nil {
2283			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 438, Col: 49}
2284		}
2285		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2286		if templ_7745c5c3_Err != nil {
2287			return templ_7745c5c3_Err
2288		}
2289		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, "</span><kbd aria-hidden=\"true\">g f</kbd> <button type=\"button\" class=\"btn icon fold\" data-js aria-expanded=\"true\" title=\"fold the list of files\" hx-on:click=\"ermiteMR.foldFiles()\"><span class=\"ico i-chevron\" aria-hidden=\"true\"></span><span class=\"sr\">fold the list of files</span></button></h2>")
2290		if templ_7745c5c3_Err != nil {
2291			return templ_7745c5c3_Err
2292		}
2293		templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
2294		if templ_7745c5c3_Err != nil {
2295			return templ_7745c5c3_Err
2296		}
2297		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "</section>")
2298		if templ_7745c5c3_Err != nil {
2299			return templ_7745c5c3_Err
2300		}
2301		if len(p.Verdicts) > 0 {
2302			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "<section><h2>Verdicts</h2><ul>")
2303			if templ_7745c5c3_Err != nil {
2304				return templ_7745c5c3_Err
2305			}
2306			for _, v := range p.Verdicts {
2307				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "<li><a href=\"")
2308				if templ_7745c5c3_Err != nil {
2309					return templ_7745c5c3_Err
2310				}
2311				var templ_7745c5c3_Var110 templ.SafeURL
2312				templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(v.Href))
2313				if templ_7745c5c3_Err != nil {
2314					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 37}
2315				}
2316				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
2317				if templ_7745c5c3_Err != nil {
2318					return templ_7745c5c3_Err
2319				}
2320				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "\">")
2321				if templ_7745c5c3_Err != nil {
2322					return templ_7745c5c3_Err
2323				}
2324				var templ_7745c5c3_Var111 string
2325				templ_7745c5c3_Var111, templ_7745c5c3_Err = templ.JoinStringErrs(v.Author)
2326				if templ_7745c5c3_Err != nil {
2327					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 50}
2328				}
2329				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var111))
2330				if templ_7745c5c3_Err != nil {
2331					return templ_7745c5c3_Err
2332				}
2333				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, ": ")
2334				if templ_7745c5c3_Err != nil {
2335					return templ_7745c5c3_Err
2336				}
2337				var templ_7745c5c3_Var112 string
2338				templ_7745c5c3_Var112, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
2339				if templ_7745c5c3_Err != nil {
2340					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 451, Col: 63}
2341				}
2342				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
2343				if templ_7745c5c3_Err != nil {
2344					return templ_7745c5c3_Err
2345				}
2346				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, "</a> ")
2347				if templ_7745c5c3_Err != nil {
2348					return templ_7745c5c3_Err
2349				}
2350				if v.Stale {
2351					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "<span class=\"mute\">(stale)</span>")
2352					if templ_7745c5c3_Err != nil {
2353						return templ_7745c5c3_Err
2354					}
2355				}
2356				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "</li>")
2357				if templ_7745c5c3_Err != nil {
2358					return templ_7745c5c3_Err
2359				}
2360			}
2361			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "</ul></section>")
2362			if templ_7745c5c3_Err != nil {
2363				return templ_7745c5c3_Err
2364			}
2365		}
2366		return nil
2367	})
2368}
2369
2370// mrBar is the bar above the diff, which follows the review: the totals, the
2371// layout of the diff, the state of the checks and, for the owner of an open
2372// request, the merge menu and the other actions. Each menu is a <details>: it
2373// works without scripts; with them, M and the keys of the menu drive it.
2374func mrBar(p MRPage) templ.Component {
2375	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2376		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2377		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2378			return templ_7745c5c3_CtxErr
2379		}
2380		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2381		if !templ_7745c5c3_IsBuffer {
2382			defer func() {
2383				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2384				if templ_7745c5c3_Err == nil {
2385					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2386				}
2387			}()
2388		}
2389		ctx = templ.InitializeContext(ctx)
2390		templ_7745c5c3_Var113 := templ.GetChildren(ctx)
2391		if templ_7745c5c3_Var113 == nil {
2392			templ_7745c5c3_Var113 = templ.NopComponent
2393		}
2394		ctx = templ.ClearChildren(ctx)
2395		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
2396		if templ_7745c5c3_Err != nil {
2397			return templ_7745c5c3_Err
2398		}
2399		var templ_7745c5c3_Var114 string
2400		templ_7745c5c3_Var114, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2401		if templ_7745c5c3_Err != nil {
2402			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 55}
2403		}
2404		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var114))
2405		if templ_7745c5c3_Err != nil {
2406			return templ_7745c5c3_Err
2407		}
2408		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, " · <span class=\"plus\">+")
2409		if templ_7745c5c3_Err != nil {
2410			return templ_7745c5c3_Err
2411		}
2412		var templ_7745c5c3_Var115 string
2413		templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2414		if templ_7745c5c3_Err != nil {
2415			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 95}
2416		}
2417		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
2418		if templ_7745c5c3_Err != nil {
2419			return templ_7745c5c3_Err
2420		}
2421		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "</span> <span class=\"minus\">-")
2422		if templ_7745c5c3_Err != nil {
2423			return templ_7745c5c3_Err
2424		}
2425		var templ_7745c5c3_Var116 string
2426		templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2427		if templ_7745c5c3_Err != nil {
2428			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 468, Col: 140}
2429		}
2430		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var116))
2431		if templ_7745c5c3_Err != nil {
2432			return templ_7745c5c3_Err
2433		}
2434		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, "</span></span>")
2435		if templ_7745c5c3_Err != nil {
2436			return templ_7745c5c3_Err
2437		}
2438		templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2439		if templ_7745c5c3_Err != nil {
2440			return templ_7745c5c3_Err
2441		}
2442		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "<span class=\"grow\"></span>")
2443		if templ_7745c5c3_Err != nil {
2444			return templ_7745c5c3_Err
2445		}
2446		templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2447		if templ_7745c5c3_Err != nil {
2448			return templ_7745c5c3_Err
2449		}
2450		if p.Box != nil {
2451			templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2452			if templ_7745c5c3_Err != nil {
2453				return templ_7745c5c3_Err
2454			}
2455		}
2456		templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
2457		if templ_7745c5c3_Err != nil {
2458			return templ_7745c5c3_Err
2459		}
2460		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "</div>")
2461		if templ_7745c5c3_Err != nil {
2462			return templ_7745c5c3_Err
2463		}
2464		return nil
2465	})
2466}
2467
2468// mergeMenu is the merge of an open request, for the owner: the form (it
2469// carries the head that was read), or "Ready for review" for a draft. The
2470// mode and the branch deletion have keys (1-3, D) while it is open.
2471//
2472// The badge is a live slot (mr-mergeability); the modes and the button read
2473// its data-* attributes (hx-live bindings), so that they follow the slot when
2474// the stream replaces its content. The server renders the same state in the
2475// attributes, for a page without scripts.
2476func mergeMenu(p MRPage) templ.Component {
2477	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2478		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2479		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2480			return templ_7745c5c3_CtxErr
2481		}
2482		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2483		if !templ_7745c5c3_IsBuffer {
2484			defer func() {
2485				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2486				if templ_7745c5c3_Err == nil {
2487					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2488				}
2489			}()
2490		}
2491		ctx = templ.InitializeContext(ctx)
2492		templ_7745c5c3_Var117 := templ.GetChildren(ctx)
2493		if templ_7745c5c3_Var117 == nil {
2494			templ_7745c5c3_Var117 = templ.NopComponent
2495		}
2496		ctx = templ.ClearChildren(ctx)
2497		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"")
2498		if templ_7745c5c3_Err != nil {
2499			return templ_7745c5c3_Err
2500		}
2501		if p.Box.Error != "" {
2502			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, " open")
2503			if templ_7745c5c3_Err != nil {
2504				return templ_7745c5c3_Err
2505			}
2506		}
2507		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2508		if templ_7745c5c3_Err != nil {
2509			return templ_7745c5c3_Err
2510		}
2511		if p.Box.ReadyAction != "" {
2512			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "Draft ")
2513			if templ_7745c5c3_Err != nil {
2514				return templ_7745c5c3_Err
2515			}
2516		} else {
2517			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "Merge ")
2518			if templ_7745c5c3_Err != nil {
2519				return templ_7745c5c3_Err
2520			}
2521		}
2522		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\">")
2523		if templ_7745c5c3_Err != nil {
2524			return templ_7745c5c3_Err
2525		}
2526		if p.Box.HeadGone {
2527			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<p class=\"dim\">the source branch was deleted</p>")
2528			if templ_7745c5c3_Err != nil {
2529				return templ_7745c5c3_Err
2530			}
2531		}
2532		if p.Box.Error != "" {
2533			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "<p class=\"d-err\" role=\"alert\">")
2534			if templ_7745c5c3_Err != nil {
2535				return templ_7745c5c3_Err
2536			}
2537			var templ_7745c5c3_Var118 string
2538			templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Error)
2539			if templ_7745c5c3_Err != nil {
2540				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 502, Col: 47}
2541			}
2542			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var118))
2543			if templ_7745c5c3_Err != nil {
2544				return templ_7745c5c3_Err
2545			}
2546			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, "</p>")
2547			if templ_7745c5c3_Err != nil {
2548				return templ_7745c5c3_Err
2549			}
2550		}
2551		if p.Box.ReadyAction != "" {
2552			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, "<p class=\"d-draft\">this is a draft: it cannot be merged until it is ready for review.</p><form class=\"d-btns\" method=\"post\" action=\"")
2553			if templ_7745c5c3_Err != nil {
2554				return templ_7745c5c3_Err
2555			}
2556			var templ_7745c5c3_Var119 templ.SafeURL
2557			templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2558			if templ_7745c5c3_Err != nil {
2559				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 506, Col: 80}
2560			}
2561			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2562			if templ_7745c5c3_Err != nil {
2563				return templ_7745c5c3_Err
2564			}
2565			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2566			if templ_7745c5c3_Err != nil {
2567				return templ_7745c5c3_Err
2568			}
2569		} else if !p.Box.HeadGone {
2570			templ_7745c5c3_Err = mrMergeabilitySlot(p.Box.Mergeability).Render(ctx, templ_7745c5c3_Buffer)
2571			if templ_7745c5c3_Err != nil {
2572				return templ_7745c5c3_Err
2573			}
2574			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, " <form class=\"d-acts\" method=\"post\" action=\"")
2575			if templ_7745c5c3_Err != nil {
2576				return templ_7745c5c3_Err
2577			}
2578			var templ_7745c5c3_Var120 templ.SafeURL
2579			templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2580			if templ_7745c5c3_Err != nil {
2581				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 511, Col: 80}
2582			}
2583			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
2584			if templ_7745c5c3_Err != nil {
2585				return templ_7745c5c3_Err
2586			}
2587			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2588			if templ_7745c5c3_Err != nil {
2589				return templ_7745c5c3_Err
2590			}
2591			var templ_7745c5c3_Var121 string
2592			templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2593			if templ_7745c5c3_Err != nil {
2594				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 512, Col: 59}
2595			}
2596			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var121)
2597			if templ_7745c5c3_Err != nil {
2598				return templ_7745c5c3_Err
2599			}
2600			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2601			if templ_7745c5c3_Err != nil {
2602				return templ_7745c5c3_Err
2603			}
2604			for i, m := range p.Box.Modes {
2605				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, "<label><input type=\"radio\" name=\"mode\" value=\"")
2606				if templ_7745c5c3_Err != nil {
2607					return templ_7745c5c3_Err
2608				}
2609				var templ_7745c5c3_Var122 string
2610				templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2611				if templ_7745c5c3_Err != nil {
2612					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 520, Col: 24}
2613				}
2614				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var122)
2615				if templ_7745c5c3_Err != nil {
2616					return templ_7745c5c3_Err
2617				}
2618				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, "\"")
2619				if templ_7745c5c3_Err != nil {
2620					return templ_7745c5c3_Err
2621				}
2622				if i == p.Box.Checked() {
2623					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, " checked")
2624					if templ_7745c5c3_Err != nil {
2625						return templ_7745c5c3_Err
2626					}
2627				}
2628				if m.Disabled {
2629					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, " disabled")
2630					if templ_7745c5c3_Err != nil {
2631						return templ_7745c5c3_Err
2632					}
2633				}
2634				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, " title=\"")
2635				if templ_7745c5c3_Err != nil {
2636					return templ_7745c5c3_Err
2637				}
2638				var templ_7745c5c3_Var123 string
2639				templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Reason)
2640				if templ_7745c5c3_Err != nil {
2641					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 523, Col: 25}
2642				}
2643				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var123)
2644				if templ_7745c5c3_Err != nil {
2645					return templ_7745c5c3_Err
2646				}
2647				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "\" :disabled=\"this.value === 'fast-forward' ? q('[data-mergeability]').data.ffOk !== true : q('[data-mergeability]').data.mergeOk !== true\" :title=\"this.value === 'fast-forward' ? q('[data-mergeability]').data.ffReason : q('[data-mergeability]').data.mergeReason\"> ")
2648				if templ_7745c5c3_Err != nil {
2649					return templ_7745c5c3_Err
2650				}
2651				var templ_7745c5c3_Var124 string
2652				templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2653				if templ_7745c5c3_Err != nil {
2654					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 527, Col: 17}
2655				}
2656				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var124))
2657				if templ_7745c5c3_Err != nil {
2658					return templ_7745c5c3_Err
2659				}
2660				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, " ")
2661				if templ_7745c5c3_Err != nil {
2662					return templ_7745c5c3_Err
2663				}
2664				if i < 9 {
2665					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, "<kbd aria-hidden=\"true\">")
2666					if templ_7745c5c3_Err != nil {
2667						return templ_7745c5c3_Err
2668					}
2669					var templ_7745c5c3_Var125 string
2670					templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2671					if templ_7745c5c3_Err != nil {
2672						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 529, Col: 46}
2673					}
2674					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var125))
2675					if templ_7745c5c3_Err != nil {
2676						return templ_7745c5c3_Err
2677					}
2678					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, "</kbd>")
2679					if templ_7745c5c3_Err != nil {
2680						return templ_7745c5c3_Err
2681					}
2682				}
2683				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, "</label>")
2684				if templ_7745c5c3_Err != nil {
2685					return templ_7745c5c3_Err
2686				}
2687			}
2688			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "</fieldset>")
2689			if templ_7745c5c3_Err != nil {
2690				return templ_7745c5c3_Err
2691			}
2692			if p.Box.CanDeleteBranch {
2693				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2694				if templ_7745c5c3_Err != nil {
2695					return templ_7745c5c3_Err
2696				}
2697				var templ_7745c5c3_Var126 string
2698				templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2699				if templ_7745c5c3_Err != nil {
2700					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 535, Col: 102}
2701				}
2702				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var126))
2703				if templ_7745c5c3_Err != nil {
2704					return templ_7745c5c3_Err
2705				}
2706				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2707				if templ_7745c5c3_Err != nil {
2708					return templ_7745c5c3_Err
2709				}
2710			}
2711			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default")
2712			if templ_7745c5c3_Err != nil {
2713				return templ_7745c5c3_Err
2714			}
2715			if !p.Box.CanMerge() {
2716				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, " disabled")
2717				if templ_7745c5c3_Err != nil {
2718					return templ_7745c5c3_Err
2719				}
2720			}
2721			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, " title=\"")
2722			if templ_7745c5c3_Err != nil {
2723				return templ_7745c5c3_Err
2724			}
2725			var templ_7745c5c3_Var127 string
2726			templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.MergeTitle())
2727			if templ_7745c5c3_Err != nil {
2728				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 543, Col: 33}
2729			}
2730			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var127)
2731			if templ_7745c5c3_Err != nil {
2732				return templ_7745c5c3_Err
2733			}
2734			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, "\" :disabled=\"!this.form.querySelector('input[name=mode]:checked:not(:disabled)')\" :title=\"(this.form.querySelector('input[name=mode]:checked') || {}).title || ''\">Merge into ")
2735			if templ_7745c5c3_Err != nil {
2736				return templ_7745c5c3_Err
2737			}
2738			var templ_7745c5c3_Var128 string
2739			templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2740			if templ_7745c5c3_Err != nil {
2741				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 546, Col: 28}
2742			}
2743			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2744			if templ_7745c5c3_Err != nil {
2745				return templ_7745c5c3_Err
2746			}
2747			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, "</button></div></form>")
2748			if templ_7745c5c3_Err != nil {
2749				return templ_7745c5c3_Err
2750			}
2751		}
2752		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "</div></details>")
2753		if templ_7745c5c3_Err != nil {
2754			return templ_7745c5c3_Err
2755		}
2756		return nil
2757	})
2758}
2759
2760// MRMergeability is the content of the mergeability slot: the badge, and the
2761// state the controls of the merge box read.
2762func MRMergeability(v MergeabilityView) templ.Component {
2763	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2764		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2765		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2766			return templ_7745c5c3_CtxErr
2767		}
2768		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2769		if !templ_7745c5c3_IsBuffer {
2770			defer func() {
2771				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2772				if templ_7745c5c3_Err == nil {
2773					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2774				}
2775			}()
2776		}
2777		ctx = templ.InitializeContext(ctx)
2778		templ_7745c5c3_Var129 := templ.GetChildren(ctx)
2779		if templ_7745c5c3_Var129 == nil {
2780			templ_7745c5c3_Var129 = templ.NopComponent
2781		}
2782		ctx = templ.ClearChildren(ctx)
2783		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, "<span data-mergeability data-state=\"")
2784		if templ_7745c5c3_Err != nil {
2785			return templ_7745c5c3_Err
2786		}
2787		var templ_7745c5c3_Var130 string
2788		templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2789		if templ_7745c5c3_Err != nil {
2790			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 559, Col: 22}
2791		}
2792		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var130)
2793		if templ_7745c5c3_Err != nil {
2794			return templ_7745c5c3_Err
2795		}
2796		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, "\" data-ff-ok=\"")
2797		if templ_7745c5c3_Err != nil {
2798			return templ_7745c5c3_Err
2799		}
2800		var templ_7745c5c3_Var131 string
2801		templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.FFOk))
2802		if templ_7745c5c3_Err != nil {
2803			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 560, Col: 41}
2804		}
2805		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var131)
2806		if templ_7745c5c3_Err != nil {
2807			return templ_7745c5c3_Err
2808		}
2809		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "\" data-merge-ok=\"")
2810		if templ_7745c5c3_Err != nil {
2811			return templ_7745c5c3_Err
2812		}
2813		var templ_7745c5c3_Var132 string
2814		templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.MergeOk))
2815		if templ_7745c5c3_Err != nil {
2816			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 561, Col: 47}
2817		}
2818		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var132)
2819		if templ_7745c5c3_Err != nil {
2820			return templ_7745c5c3_Err
2821		}
2822		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "\" data-ff-reason=\"")
2823		if templ_7745c5c3_Err != nil {
2824			return templ_7745c5c3_Err
2825		}
2826		var templ_7745c5c3_Var133 string
2827		templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.FFReason)
2828		if templ_7745c5c3_Err != nil {
2829			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 562, Col: 29}
2830		}
2831		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var133)
2832		if templ_7745c5c3_Err != nil {
2833			return templ_7745c5c3_Err
2834		}
2835		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "\" data-merge-reason=\"")
2836		if templ_7745c5c3_Err != nil {
2837			return templ_7745c5c3_Err
2838		}
2839		var templ_7745c5c3_Var134 string
2840		templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.MergeReason)
2841		if templ_7745c5c3_Err != nil {
2842			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 563, Col: 35}
2843		}
2844		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var134)
2845		if templ_7745c5c3_Err != nil {
2846			return templ_7745c5c3_Err
2847		}
2848		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "\"><span class=\"badge\" data-state=\"")
2849		if templ_7745c5c3_Err != nil {
2850			return templ_7745c5c3_Err
2851		}
2852		var templ_7745c5c3_Var135 string
2853		templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2854		if templ_7745c5c3_Err != nil {
2855			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 565, Col: 42}
2856		}
2857		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var135)
2858		if templ_7745c5c3_Err != nil {
2859			return templ_7745c5c3_Err
2860		}
2861		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "\">")
2862		if templ_7745c5c3_Err != nil {
2863			return templ_7745c5c3_Err
2864		}
2865		var templ_7745c5c3_Var136 string
2866		templ_7745c5c3_Var136, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
2867		if templ_7745c5c3_Err != nil {
2868			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 565, Col: 54}
2869		}
2870		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var136))
2871		if templ_7745c5c3_Err != nil {
2872			return templ_7745c5c3_Err
2873		}
2874		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "</span> ")
2875		if templ_7745c5c3_Err != nil {
2876			return templ_7745c5c3_Err
2877		}
2878		if v.Detail != "" {
2879			var templ_7745c5c3_Var137 string
2880			templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2881			if templ_7745c5c3_Err != nil {
2882				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 567, Col: 8}
2883			}
2884			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var137))
2885			if templ_7745c5c3_Err != nil {
2886				return templ_7745c5c3_Err
2887			}
2888			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "<span class=\"dim\">")
2889			if templ_7745c5c3_Err != nil {
2890				return templ_7745c5c3_Err
2891			}
2892			var templ_7745c5c3_Var138 string
2893			templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.JoinStringErrs(v.Detail)
2894			if templ_7745c5c3_Err != nil {
2895				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 567, Col: 38}
2896			}
2897			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var138))
2898			if templ_7745c5c3_Err != nil {
2899				return templ_7745c5c3_Err
2900			}
2901			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, "</span>")
2902			if templ_7745c5c3_Err != nil {
2903				return templ_7745c5c3_Err
2904			}
2905		}
2906		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "</span> ")
2907		if templ_7745c5c3_Err != nil {
2908			return templ_7745c5c3_Err
2909		}
2910		if len(v.Paths) > 0 {
2911			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "<ul class=\"mg-paths\" aria-label=\"conflicting files\">")
2912			if templ_7745c5c3_Err != nil {
2913				return templ_7745c5c3_Err
2914			}
2915			for _, path := range v.Paths {
2916				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "<li><code>")
2917				if templ_7745c5c3_Err != nil {
2918					return templ_7745c5c3_Err
2919				}
2920				var templ_7745c5c3_Var139 string
2921				templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.JoinStringErrs(path)
2922				if templ_7745c5c3_Err != nil {
2923					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 573, Col: 20}
2924				}
2925				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var139))
2926				if templ_7745c5c3_Err != nil {
2927					return templ_7745c5c3_Err
2928				}
2929				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, "</code></li>")
2930				if templ_7745c5c3_Err != nil {
2931					return templ_7745c5c3_Err
2932				}
2933			}
2934			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, "</ul>")
2935			if templ_7745c5c3_Err != nil {
2936				return templ_7745c5c3_Err
2937			}
2938		}
2939		if v.PathsNote != "" {
2940			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "<p class=\"dim\">")
2941			if templ_7745c5c3_Err != nil {
2942				return templ_7745c5c3_Err
2943			}
2944			var templ_7745c5c3_Var140 string
2945			templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.JoinStringErrs(v.PathsNote)
2946			if templ_7745c5c3_Err != nil {
2947				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 578, Col: 30}
2948			}
2949			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var140))
2950			if templ_7745c5c3_Err != nil {
2951				return templ_7745c5c3_Err
2952			}
2953			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "</p>")
2954			if templ_7745c5c3_Err != nil {
2955				return templ_7745c5c3_Err
2956			}
2957		}
2958		return nil
2959	})
2960}
2961
2962// mrMergeabilitySlot is the status region of the badge, with its content: the
2963// stream replaces the children, never the element (see LiveSlot).
2964func mrMergeabilitySlot(v MergeabilityView) templ.Component {
2965	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2966		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2967		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2968			return templ_7745c5c3_CtxErr
2969		}
2970		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2971		if !templ_7745c5c3_IsBuffer {
2972			defer func() {
2973				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2974				if templ_7745c5c3_Err == nil {
2975					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2976				}
2977			}()
2978		}
2979		ctx = templ.InitializeContext(ctx)
2980		templ_7745c5c3_Var141 := templ.GetChildren(ctx)
2981		if templ_7745c5c3_Var141 == nil {
2982			templ_7745c5c3_Var141 = templ.NopComponent
2983		}
2984		ctx = templ.ClearChildren(ctx)
2985		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "<div id=\"mr-mergeability\" class=\"live-slot\" role=\"status\" data-slot>")
2986		if templ_7745c5c3_Err != nil {
2987			return templ_7745c5c3_Err
2988		}
2989		templ_7745c5c3_Err = MRMergeability(v).Render(ctx, templ_7745c5c3_Buffer)
2990		if templ_7745c5c3_Err != nil {
2991			return templ_7745c5c3_Err
2992		}
2993		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, "</div>")
2994		if templ_7745c5c3_Err != nil {
2995			return templ_7745c5c3_Err
2996		}
2997		return nil
2998	})
2999}
3000
3001// MRMergeabilityFragment is the slot as the stream sends it.
3002func MRMergeabilityFragment(v MergeabilityView) templ.Component {
3003	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3004		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3005		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3006			return templ_7745c5c3_CtxErr
3007		}
3008		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3009		if !templ_7745c5c3_IsBuffer {
3010			defer func() {
3011				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3012				if templ_7745c5c3_Err == nil {
3013					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3014				}
3015			}()
3016		}
3017		ctx = templ.InitializeContext(ctx)
3018		templ_7745c5c3_Var142 := templ.GetChildren(ctx)
3019		if templ_7745c5c3_Var142 == nil {
3020			templ_7745c5c3_Var142 = templ.NopComponent
3021		}
3022		ctx = templ.ClearChildren(ctx)
3023		templ_7745c5c3_Err = mrMergeabilitySlot(v).Render(ctx, templ_7745c5c3_Buffer)
3024		if templ_7745c5c3_Err != nil {
3025			return templ_7745c5c3_Err
3026		}
3027		return nil
3028	})
3029}
3030
3031// moreMenu shows read-only settings to every viewer, and keeps owner actions
3032// behind the same merge-box permission as before.
3033func moreMenu(p MRPage) templ.Component {
3034	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3035		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3036		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3037			return templ_7745c5c3_CtxErr
3038		}
3039		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3040		if !templ_7745c5c3_IsBuffer {
3041			defer func() {
3042				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3043				if templ_7745c5c3_Err == nil {
3044					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3045				}
3046			}()
3047		}
3048		ctx = templ.InitializeContext(ctx)
3049		templ_7745c5c3_Var143 := templ.GetChildren(ctx)
3050		if templ_7745c5c3_Var143 == nil {
3051			templ_7745c5c3_Var143 = templ.NopComponent
3052		}
3053		ctx = templ.ClearChildren(ctx)
3054		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, "<details class=\"menu omenu\"><summary class=\"btn icon\" aria-label=\"More actions\" title=\"more actions\">⋯</summary><div class=\"menu-pop\" role=\"group\" aria-label=\"More actions\"><section class=\"merge-settings\"><h2>Merge settings</h2><dl class=\"kv\"><dt>modes</dt><dd>")
3055		if templ_7745c5c3_Err != nil {
3056			return templ_7745c5c3_Err
3057		}
3058		var templ_7745c5c3_Var144 string
3059		templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
3060		if templ_7745c5c3_Err != nil {
3061			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 605, Col: 38}
3062		}
3063		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var144))
3064		if templ_7745c5c3_Err != nil {
3065			return templ_7745c5c3_Err
3066		}
3067		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "</dd><dt>checks</dt><dd>")
3068		if templ_7745c5c3_Err != nil {
3069			return templ_7745c5c3_Err
3070		}
3071		if p.ChecksBlock {
3072			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "failing ones block the merge")
3073			if templ_7745c5c3_Err != nil {
3074				return templ_7745c5c3_Err
3075			}
3076		} else {
3077			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "do not block the merge")
3078			if templ_7745c5c3_Err != nil {
3079				return templ_7745c5c3_Err
3080			}
3081		}
3082		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, "</dd></dl></section>")
3083		if templ_7745c5c3_Err != nil {
3084			return templ_7745c5c3_Err
3085		}
3086		if p.Box != nil {
3087			if p.Box.Signed {
3088				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "<p class=\"d-note\" id=\"mr-signing\">squash and merge commits are signed with ermite's own key (generated on first start). ")
3089				if templ_7745c5c3_Err != nil {
3090					return templ_7745c5c3_Err
3091				}
3092				if p.Box.Fingerprint != "" {
3093					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "fingerprint <code>")
3094					if templ_7745c5c3_Err != nil {
3095						return templ_7745c5c3_Err
3096					}
3097					var templ_7745c5c3_Var145 string
3098					templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Fingerprint)
3099					if templ_7745c5c3_Err != nil {
3100						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 621, Col: 44}
3101					}
3102					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145))
3103					if templ_7745c5c3_Err != nil {
3104						return templ_7745c5c3_Err
3105					}
3106					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "</code> ")
3107					if templ_7745c5c3_Err != nil {
3108						return templ_7745c5c3_Err
3109					}
3110				}
3111				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "<code>ermite signing-key show</code> prints it.</p>")
3112				if templ_7745c5c3_Err != nil {
3113					return templ_7745c5c3_Err
3114				}
3115			}
3116			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, " ")
3117			if templ_7745c5c3_Err != nil {
3118				return templ_7745c5c3_Err
3119			}
3120			if p.Box.CanMarkRead {
3121				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "<form method=\"post\" action=\"")
3122				if templ_7745c5c3_Err != nil {
3123					return templ_7745c5c3_Err
3124				}
3125				var templ_7745c5c3_Var146 templ.SafeURL
3126				templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
3127				if templ_7745c5c3_Err != nil {
3128					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 627, Col: 65}
3129				}
3130				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
3131				if templ_7745c5c3_Err != nil {
3132					return templ_7745c5c3_Err
3133				}
3134				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
3135				if templ_7745c5c3_Err != nil {
3136					return templ_7745c5c3_Err
3137				}
3138				var templ_7745c5c3_Var147 string
3139				templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
3140				if templ_7745c5c3_Err != nil {
3141					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 628, Col: 60}
3142				}
3143				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var147)
3144				if templ_7745c5c3_Err != nil {
3145					return templ_7745c5c3_Err
3146				}
3147				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "\"> <button type=\"submit\" title=\"the next visit can show only what changed after this head\" class=\"btn\" aria-keyshortcuts=\"Shift+R\" data-read>Mark read <kbd aria-hidden=\"true\">R</kbd></button></form>")
3148				if templ_7745c5c3_Err != nil {
3149					return templ_7745c5c3_Err
3150				}
3151			}
3152			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, " <form method=\"post\" action=\"")
3153			if templ_7745c5c3_Err != nil {
3154				return templ_7745c5c3_Err
3155			}
3156			var templ_7745c5c3_Var148 templ.SafeURL
3157			templ_7745c5c3_Var148, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
3158			if templ_7745c5c3_Err != nil {
3159				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 632, Col: 65}
3160			}
3161			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var148))
3162			if templ_7745c5c3_Err != nil {
3163				return templ_7745c5c3_Err
3164			}
3165			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
3166			if templ_7745c5c3_Err != nil {
3167				return templ_7745c5c3_Err
3168			}
3169			if !p.Box.HeadGone && p.Box.ReadyAction == "" {
3170				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
3171				if templ_7745c5c3_Err != nil {
3172					return templ_7745c5c3_Err
3173				}
3174				templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
3175				if templ_7745c5c3_Err != nil {
3176					return templ_7745c5c3_Err
3177				}
3178				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, "</details>")
3179				if templ_7745c5c3_Err != nil {
3180					return templ_7745c5c3_Err
3181				}
3182			}
3183		}
3184		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "</div></details>")
3185		if templ_7745c5c3_Err != nil {
3186			return templ_7745c5c3_Err
3187		}
3188		return nil
3189	})
3190}
3191
3192func Compare(l Layout, p ComparePage) templ.Component {
3193	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3194		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3195		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3196			return templ_7745c5c3_CtxErr
3197		}
3198		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3199		if !templ_7745c5c3_IsBuffer {
3200			defer func() {
3201				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3202				if templ_7745c5c3_Err == nil {
3203					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3204				}
3205			}()
3206		}
3207		ctx = templ.InitializeContext(ctx)
3208		templ_7745c5c3_Var149 := templ.GetChildren(ctx)
3209		if templ_7745c5c3_Var149 == nil {
3210			templ_7745c5c3_Var149 = templ.NopComponent
3211		}
3212		ctx = templ.ClearChildren(ctx)
3213		templ_7745c5c3_Var150 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3214			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3215			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3216			if !templ_7745c5c3_IsBuffer {
3217				defer func() {
3218					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3219					if templ_7745c5c3_Err == nil {
3220						templ_7745c5c3_Err = templ_7745c5c3_BufErr
3221					}
3222				}()
3223			}
3224			ctx = templ.InitializeContext(ctx)
3225			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "<header class=\"show mr-h\"><h1>")
3226			if templ_7745c5c3_Err != nil {
3227				return templ_7745c5c3_Err
3228			}
3229			var templ_7745c5c3_Var151 string
3230			templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3231			if templ_7745c5c3_Err != nil {
3232				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 649, Col: 17}
3233			}
3234			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
3235			if templ_7745c5c3_Err != nil {
3236				return templ_7745c5c3_Err
3237			}
3238			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, " → ")
3239			if templ_7745c5c3_Err != nil {
3240				return templ_7745c5c3_Err
3241			}
3242			var templ_7745c5c3_Var152 string
3243			templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3244			if templ_7745c5c3_Err != nil {
3245				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 649, Col: 34}
3246			}
3247			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3248			if templ_7745c5c3_Err != nil {
3249				return templ_7745c5c3_Err
3250			}
3251			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
3252			if templ_7745c5c3_Err != nil {
3253				return templ_7745c5c3_Err
3254			}
3255			var templ_7745c5c3_Var153 templ.SafeURL
3256			templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
3257			if templ_7745c5c3_Err != nil {
3258				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 652, Col: 45}
3259			}
3260			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
3261			if templ_7745c5c3_Err != nil {
3262				return templ_7745c5c3_Err
3263			}
3264			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "\">")
3265			if templ_7745c5c3_Err != nil {
3266				return templ_7745c5c3_Err
3267			}
3268			var templ_7745c5c3_Var154 string
3269			templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3270			if templ_7745c5c3_Err != nil {
3271				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 652, Col: 58}
3272			}
3273			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var154))
3274			if templ_7745c5c3_Err != nil {
3275				return templ_7745c5c3_Err
3276			}
3277			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "</a></dd><dt>target</dt><dd><a href=\"")
3278			if templ_7745c5c3_Err != nil {
3279				return templ_7745c5c3_Err
3280			}
3281			var templ_7745c5c3_Var155 templ.SafeURL
3282			templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
3283			if templ_7745c5c3_Err != nil {
3284				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 654, Col: 45}
3285			}
3286			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
3287			if templ_7745c5c3_Err != nil {
3288				return templ_7745c5c3_Err
3289			}
3290			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "\">")
3291			if templ_7745c5c3_Err != nil {
3292				return templ_7745c5c3_Err
3293			}
3294			var templ_7745c5c3_Var156 string
3295			templ_7745c5c3_Var156, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3296			if templ_7745c5c3_Err != nil {
3297				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 654, Col: 58}
3298			}
3299			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var156))
3300			if templ_7745c5c3_Err != nil {
3301				return templ_7745c5c3_Err
3302			}
3303			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "</a></dd><dt>ahead</dt><dd>")
3304			if templ_7745c5c3_Err != nil {
3305				return templ_7745c5c3_Err
3306			}
3307			var templ_7745c5c3_Var157 string
3308			templ_7745c5c3_Var157, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
3309			if templ_7745c5c3_Err != nil {
3310				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 656, Col: 21}
3311			}
3312			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var157))
3313			if templ_7745c5c3_Err != nil {
3314				return templ_7745c5c3_Err
3315			}
3316			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, "</dd></dl></header>")
3317			if templ_7745c5c3_Err != nil {
3318				return templ_7745c5c3_Err
3319			}
3320			if p.Note != "" {
3321				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, "<p class=\"notice\">")
3322				if templ_7745c5c3_Err != nil {
3323					return templ_7745c5c3_Err
3324				}
3325				var templ_7745c5c3_Var158 string
3326				templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
3327				if templ_7745c5c3_Err != nil {
3328					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 660, Col: 29}
3329				}
3330				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3331				if templ_7745c5c3_Err != nil {
3332					return templ_7745c5c3_Err
3333				}
3334				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 308, "</p>")
3335				if templ_7745c5c3_Err != nil {
3336					return templ_7745c5c3_Err
3337				}
3338			}
3339			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, " ")
3340			if templ_7745c5c3_Err != nil {
3341				return templ_7745c5c3_Err
3342			}
3343			if p.Existing != nil {
3344				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
3345				if templ_7745c5c3_Err != nil {
3346					return templ_7745c5c3_Err
3347				}
3348				var templ_7745c5c3_Var159 templ.SafeURL
3349				templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
3350				if templ_7745c5c3_Err != nil {
3351					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 663, Col: 114}
3352				}
3353				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
3354				if templ_7745c5c3_Err != nil {
3355					return templ_7745c5c3_Err
3356				}
3357				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 311, "\">")
3358				if templ_7745c5c3_Err != nil {
3359					return templ_7745c5c3_Err
3360				}
3361				var templ_7745c5c3_Var160 string
3362				templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
3363				if templ_7745c5c3_Err != nil {
3364					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 663, Col: 135}
3365				}
3366				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3367				if templ_7745c5c3_Err != nil {
3368					return templ_7745c5c3_Err
3369				}
3370				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 312, "</a></p>")
3371				if templ_7745c5c3_Err != nil {
3372					return templ_7745c5c3_Err
3373				}
3374			}
3375			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, " ")
3376			if templ_7745c5c3_Err != nil {
3377				return templ_7745c5c3_Err
3378			}
3379			if p.Create != nil {
3380				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, "<form class=\"cform create\" method=\"post\" action=\"")
3381				if templ_7745c5c3_Err != nil {
3382					return templ_7745c5c3_Err
3383				}
3384				var templ_7745c5c3_Var161 templ.SafeURL
3385				templ_7745c5c3_Var161, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
3386				if templ_7745c5c3_Err != nil {
3387					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 666, Col: 83}
3388				}
3389				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var161))
3390				if templ_7745c5c3_Err != nil {
3391					return templ_7745c5c3_Err
3392				}
3393				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 315, "\"><input type=\"hidden\" name=\"source\" value=\"")
3394				if templ_7745c5c3_Err != nil {
3395					return templ_7745c5c3_Err
3396				}
3397				var templ_7745c5c3_Var162 string
3398				templ_7745c5c3_Var162, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
3399				if templ_7745c5c3_Err != nil {
3400					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 667, Col: 62}
3401				}
3402				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var162)
3403				if templ_7745c5c3_Err != nil {
3404					return templ_7745c5c3_Err
3405				}
3406				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 316, "\"> <input type=\"hidden\" name=\"target\" value=\"")
3407				if templ_7745c5c3_Err != nil {
3408					return templ_7745c5c3_Err
3409				}
3410				var templ_7745c5c3_Var163 string
3411				templ_7745c5c3_Var163, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
3412				if templ_7745c5c3_Err != nil {
3413					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 668, Col: 62}
3414				}
3415				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var163)
3416				if templ_7745c5c3_Err != nil {
3417					return templ_7745c5c3_Err
3418				}
3419				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 317, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
3420				if templ_7745c5c3_Err != nil {
3421					return templ_7745c5c3_Err
3422				}
3423				var templ_7745c5c3_Var164 string
3424				templ_7745c5c3_Var164, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
3425				if templ_7745c5c3_Err != nil {
3426					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 670, Col: 97}
3427				}
3428				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var164)
3429				if templ_7745c5c3_Err != nil {
3430					return templ_7745c5c3_Err
3431				}
3432				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 318, "\" autocomplete=\"off\"> <label for=\"mr-desc\">description</label> <textarea id=\"mr-desc\" name=\"description\" rows=\"4\" maxlength=\"8000\" placeholder=\"Markdown, optional\"></textarea><div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Create merge request</button></div></form>")
3433				if templ_7745c5c3_Err != nil {
3434					return templ_7745c5c3_Err
3435				}
3436			}
3437			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 319, " ")
3438			if templ_7745c5c3_Err != nil {
3439				return templ_7745c5c3_Err
3440			}
3441			if p.HasDiff {
3442				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 320, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
3443				if templ_7745c5c3_Err != nil {
3444					return templ_7745c5c3_Err
3445				}
3446				var templ_7745c5c3_Var165 string
3447				templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
3448				if templ_7745c5c3_Err != nil {
3449					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 57}
3450				}
3451				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
3452				if templ_7745c5c3_Err != nil {
3453					return templ_7745c5c3_Err
3454				}
3455				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, " · <span class=\"plus\">+")
3456				if templ_7745c5c3_Err != nil {
3457					return templ_7745c5c3_Err
3458				}
3459				var templ_7745c5c3_Var166 string
3460				templ_7745c5c3_Var166, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
3461				if templ_7745c5c3_Err != nil {
3462					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 97}
3463				}
3464				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var166))
3465				if templ_7745c5c3_Err != nil {
3466					return templ_7745c5c3_Err
3467				}
3468				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "</span> <span class=\"minus\">-")
3469				if templ_7745c5c3_Err != nil {
3470					return templ_7745c5c3_Err
3471				}
3472				var templ_7745c5c3_Var167 string
3473				templ_7745c5c3_Var167, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
3474				if templ_7745c5c3_Err != nil {
3475					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 142}
3476				}
3477				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var167))
3478				if templ_7745c5c3_Err != nil {
3479					return templ_7745c5c3_Err
3480				}
3481				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "</span></span> <span class=\"grow\"></span>")
3482				if templ_7745c5c3_Err != nil {
3483					return templ_7745c5c3_Err
3484				}
3485				templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3486				if templ_7745c5c3_Err != nil {
3487					return templ_7745c5c3_Err
3488				}
3489				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "</div>")
3490				if templ_7745c5c3_Err != nil {
3491					return templ_7745c5c3_Err
3492				}
3493				if p.Invisible {
3494					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 325, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
3495					if templ_7745c5c3_Err != nil {
3496						return templ_7745c5c3_Err
3497					}
3498				}
3499				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 326, " <div id=\"diffs\"")
3500				if templ_7745c5c3_Err != nil {
3501					return templ_7745c5c3_Err
3502				}
3503				if p.Both {
3504					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 327, " data-diff=\"")
3505					if templ_7745c5c3_Err != nil {
3506						return templ_7745c5c3_Err
3507					}
3508					var templ_7745c5c3_Var168 string
3509					templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3510					if templ_7745c5c3_Err != nil {
3511						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 693, Col: 23}
3512					}
3513					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var168)
3514					if templ_7745c5c3_Err != nil {
3515						return templ_7745c5c3_Err
3516					}
3517					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 328, "\"")
3518					if templ_7745c5c3_Err != nil {
3519						return templ_7745c5c3_Err
3520					}
3521				} else {
3522					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 329, " data-view=\"")
3523					if templ_7745c5c3_Err != nil {
3524						return templ_7745c5c3_Err
3525					}
3526					var templ_7745c5c3_Var169 string
3527					templ_7745c5c3_Var169, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3528					if templ_7745c5c3_Err != nil {
3529						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 695, Col: 23}
3530					}
3531					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var169)
3532					if templ_7745c5c3_Err != nil {
3533						return templ_7745c5c3_Err
3534					}
3535					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 330, "\"")
3536					if templ_7745c5c3_Err != nil {
3537						return templ_7745c5c3_Err
3538					}
3539				}
3540				if p.Both && !p.Pinned {
3541					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 331, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3542					if templ_7745c5c3_Err != nil {
3543						return templ_7745c5c3_Err
3544					}
3545				}
3546				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, ">")
3547				if templ_7745c5c3_Err != nil {
3548					return templ_7745c5c3_Err
3549				}
3550				for _, f := range p.Files {
3551					templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3552					if templ_7745c5c3_Err != nil {
3553						return templ_7745c5c3_Err
3554					}
3555				}
3556				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "</div>")
3557				if templ_7745c5c3_Err != nil {
3558					return templ_7745c5c3_Err
3559				}
3560			}
3561			return nil
3562		})
3563		templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var150), templ_7745c5c3_Buffer)
3564		if templ_7745c5c3_Err != nil {
3565			return templ_7745c5c3_Err
3566		}
3567		return nil
3568	})
3569}
3570
3571func compareRail(p ComparePage) templ.Component {
3572	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3573		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3574		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3575			return templ_7745c5c3_CtxErr
3576		}
3577		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3578		if !templ_7745c5c3_IsBuffer {
3579			defer func() {
3580				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3581				if templ_7745c5c3_Err == nil {
3582					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3583				}
3584			}()
3585		}
3586		ctx = templ.InitializeContext(ctx)
3587		templ_7745c5c3_Var170 := templ.GetChildren(ctx)
3588		if templ_7745c5c3_Var170 == nil {
3589			templ_7745c5c3_Var170 = templ.NopComponent
3590		}
3591		ctx = templ.ClearChildren(ctx)
3592		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3593		if templ_7745c5c3_Err != nil {
3594			return templ_7745c5c3_Err
3595		}
3596		var templ_7745c5c3_Var171 string
3597		templ_7745c5c3_Var171, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3598		if templ_7745c5c3_Err != nil {
3599			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 711, Col: 67}
3600		}
3601		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var171))
3602		if templ_7745c5c3_Err != nil {
3603			return templ_7745c5c3_Err
3604		}
3605		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, "</span></h2><ul class=\"pcommits\">")
3606		if templ_7745c5c3_Err != nil {
3607			return templ_7745c5c3_Err
3608		}
3609		for _, c := range p.Ahead {
3610			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "<li><a href=\"")
3611			if templ_7745c5c3_Err != nil {
3612				return templ_7745c5c3_Err
3613			}
3614			var templ_7745c5c3_Var172 templ.SafeURL
3615			templ_7745c5c3_Var172, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3616			if templ_7745c5c3_Err != nil {
3617				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 715, Col: 37}
3618			}
3619			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
3620			if templ_7745c5c3_Err != nil {
3621				return templ_7745c5c3_Err
3622			}
3623			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, "\">")
3624			if templ_7745c5c3_Err != nil {
3625				return templ_7745c5c3_Err
3626			}
3627			var templ_7745c5c3_Var173 string
3628			templ_7745c5c3_Var173, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3629			if templ_7745c5c3_Err != nil {
3630				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 715, Col: 49}
3631			}
3632			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var173))
3633			if templ_7745c5c3_Err != nil {
3634				return templ_7745c5c3_Err
3635			}
3636			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, "</a> <span class=\"s\">")
3637			if templ_7745c5c3_Err != nil {
3638				return templ_7745c5c3_Err
3639			}
3640			var templ_7745c5c3_Var174 string
3641			templ_7745c5c3_Var174, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3642			if templ_7745c5c3_Err != nil {
3643				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 716, Col: 32}
3644			}
3645			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var174))
3646			if templ_7745c5c3_Err != nil {
3647				return templ_7745c5c3_Err
3648			}
3649			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "</span> <span class=\"mute\">")
3650			if templ_7745c5c3_Err != nil {
3651				return templ_7745c5c3_Err
3652			}
3653			var templ_7745c5c3_Var175 string
3654			templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3655			if templ_7745c5c3_Err != nil {
3656				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 718, Col: 16}
3657			}
3658			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var175))
3659			if templ_7745c5c3_Err != nil {
3660				return templ_7745c5c3_Err
3661			}
3662			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, " ")
3663			if templ_7745c5c3_Err != nil {
3664				return templ_7745c5c3_Err
3665			}
3666			if c.WhenAt != "" {
3667				var templ_7745c5c3_Var176 string
3668				templ_7745c5c3_Var176, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3669				if templ_7745c5c3_Err != nil {
3670					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 720, Col: 15}
3671				}
3672				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var176))
3673				if templ_7745c5c3_Err != nil {
3674					return templ_7745c5c3_Err
3675				}
3676				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, "<time datetime=\"")
3677				if templ_7745c5c3_Err != nil {
3678					return templ_7745c5c3_Err
3679				}
3680				var templ_7745c5c3_Var177 string
3681				templ_7745c5c3_Var177, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3682				if templ_7745c5c3_Err != nil {
3683					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 720, Col: 42}
3684				}
3685				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var177)
3686				if templ_7745c5c3_Err != nil {
3687					return templ_7745c5c3_Err
3688				}
3689				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 342, "\">")
3690				if templ_7745c5c3_Err != nil {
3691					return templ_7745c5c3_Err
3692				}
3693				var templ_7745c5c3_Var178 string
3694				templ_7745c5c3_Var178, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3695				if templ_7745c5c3_Err != nil {
3696					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 720, Col: 53}
3697				}
3698				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var178))
3699				if templ_7745c5c3_Err != nil {
3700					return templ_7745c5c3_Err
3701				}
3702				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 343, "</time>")
3703				if templ_7745c5c3_Err != nil {
3704					return templ_7745c5c3_Err
3705				}
3706			}
3707			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 344, "</span></li>")
3708			if templ_7745c5c3_Err != nil {
3709				return templ_7745c5c3_Err
3710			}
3711		}
3712		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 345, "</ul>")
3713		if templ_7745c5c3_Err != nil {
3714			return templ_7745c5c3_Err
3715		}
3716		if len(p.Ahead) == 0 {
3717			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "<p class=\"dim\">no commit ahead of ")
3718			if templ_7745c5c3_Err != nil {
3719				return templ_7745c5c3_Err
3720			}
3721			var templ_7745c5c3_Var179 string
3722			templ_7745c5c3_Var179, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3723			if templ_7745c5c3_Err != nil {
3724				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 727, Col: 47}
3725			}
3726			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var179))
3727			if templ_7745c5c3_Err != nil {
3728				return templ_7745c5c3_Err
3729			}
3730			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, ".</p>")
3731			if templ_7745c5c3_Err != nil {
3732				return templ_7745c5c3_Err
3733			}
3734		}
3735		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 348, "</section>")
3736		if templ_7745c5c3_Err != nil {
3737			return templ_7745c5c3_Err
3738		}
3739		if p.HasDiff {
3740			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 349, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3741			if templ_7745c5c3_Err != nil {
3742				return templ_7745c5c3_Err
3743			}
3744			var templ_7745c5c3_Var180 string
3745			templ_7745c5c3_Var180, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3746			if templ_7745c5c3_Err != nil {
3747				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 732, Col: 66}
3748			}
3749			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var180))
3750			if templ_7745c5c3_Err != nil {
3751				return templ_7745c5c3_Err
3752			}
3753			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, "</span></h2>")
3754			if templ_7745c5c3_Err != nil {
3755				return templ_7745c5c3_Err
3756			}
3757			templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3758			if templ_7745c5c3_Err != nil {
3759				return templ_7745c5c3_Err
3760			}
3761			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, "</section>")
3762			if templ_7745c5c3_Err != nil {
3763				return templ_7745c5c3_Err
3764			}
3765		}
3766		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 352, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3767		if templ_7745c5c3_Err != nil {
3768			return templ_7745c5c3_Err
3769		}
3770		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3771		if templ_7745c5c3_Err != nil {
3772			return templ_7745c5c3_Err
3773		}
3774		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 353, "</section>")
3775		if templ_7745c5c3_Err != nil {
3776			return templ_7745c5c3_Err
3777		}
3778		return nil
3779	})
3780}
3781
3782var _ = templruntime.GeneratedTemplate

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 2

Tags 45

↑↓ moveenter openesc close