feat(webui): page through task logs
This commit is contained in:
1 parent
087ce10b86
commit
b26de90e38
11 files changed
+376
-93
No files matched your search
@@ -8307,7 +8307,11 @@ type ReadTaskLogRequest struct {
|
||||
// stage filters on an entry's own "stage" field. Only entries a stage
|
||||
// tagged carry one -- agent and tool output is logged without a stage, so a
|
||||
// stage filter narrows the file rather than covering it. Empty means any.
|
||||
Stage string `protobuf:"bytes,9,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
Stage string `protobuf:"bytes,9,opt,name=stage,proto3" json:"stage,omitempty"`
|
||||
// before_id is the byte-offset cursor a previous page returned as cursor: the
|
||||
// read returns the most recent matching entries ending at or before it. Zero
|
||||
// reads the tail, which is the page the dashboard opens on.
|
||||
BeforeId int64 `protobuf:"varint,10,opt,name=before_id,json=beforeId,proto3" json:"before_id,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -8405,6 +8409,13 @@ func (x *ReadTaskLogRequest) GetStage() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogRequest) GetBeforeId() int64 {
|
||||
if x != nil {
|
||||
return x.BeforeId
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// found=false is not an error: the task has no log file for that attempt.
|
||||
// That is a different condition from a process that cannot read logs at all
|
||||
// (codes.Unavailable), and the dashboard reports them differently.
|
||||
@@ -8418,7 +8429,13 @@ type ReadTaskLogResponse struct {
|
||||
// file is the path read, so the page can name where the log came from. It
|
||||
// is the state directory's own layout, reported to an already-authenticated
|
||||
// operator; no caller is expected to open it.
|
||||
File string `protobuf:"bytes,6,opt,name=file,proto3" json:"file,omitempty"`
|
||||
File string `protobuf:"bytes,6,opt,name=file,proto3" json:"file,omitempty"`
|
||||
// more_available reports matching entries did not fit in this page; cursor
|
||||
// is the before_id for the next older one. truncated is separate: it means
|
||||
// the log is larger than the readable scan window, so its oldest entries
|
||||
// cannot be reached by paging at all.
|
||||
MoreAvailable bool `protobuf:"varint,7,opt,name=more_available,json=moreAvailable,proto3" json:"more_available,omitempty"`
|
||||
Cursor int64 `protobuf:"varint,8,opt,name=cursor,proto3" json:"cursor,omitempty"`
|
||||
unknownFields protoimpl.UnknownFields
|
||||
sizeCache protoimpl.SizeCache
|
||||
}
|
||||
@@ -8495,6 +8512,20 @@ func (x *ReadTaskLogResponse) GetFile() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetMoreAvailable() bool {
|
||||
if x != nil {
|
||||
return x.MoreAvailable
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *ReadTaskLogResponse) GetCursor() int64 {
|
||||
if x != nil {
|
||||
return x.Cursor
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, for a download. The
|
||||
// bytes are the file's own JSONL, not a re-encoding of it: this contract
|
||||
// transports the log, it does not restate the format. found=false, with no
|
||||
@@ -15085,7 +15116,7 @@ const file_state_v1_state_proto_rawDesc = "" +
|
||||
"\x05level\x18\x03 \x01(\tR\x05level\x12\x10\n" +
|
||||
"\x03msg\x18\x04 \x01(\tR\x03msg\x12\x1f\n" +
|
||||
"\vfields_json\x18\x05 \x01(\tR\n" +
|
||||
"fieldsJson\"\xa9\x02\n" +
|
||||
"fieldsJson\"\xc6\x02\n" +
|
||||
"\x12ReadTaskLogRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\aattempt\x18\x02 \x01(\x03R\aattempt\x12\x14\n" +
|
||||
@@ -15095,7 +15126,9 @@ const file_state_v1_state_proto_rawDesc = "" +
|
||||
"\bcontains\x18\x06 \x01(\tR\bcontains\x120\n" +
|
||||
"\x05since\x18\a \x01(\v2\x1a.google.protobuf.TimestampR\x05since\x120\n" +
|
||||
"\x05until\x18\b \x01(\v2\x1a.google.protobuf.TimestampR\x05until\x12\x14\n" +
|
||||
"\x05stage\x18\t \x01(\tR\x05stage\"\xc9\x01\n" +
|
||||
"\x05stage\x18\t \x01(\tR\x05stage\x12\x1b\n" +
|
||||
"\tbefore_id\x18\n" +
|
||||
" \x01(\x03R\bbeforeId\"\x88\x02\n" +
|
||||
"\x13ReadTaskLogResponse\x120\n" +
|
||||
"\aentries\x18\x01 \x03(\v2\x16.state.v1.TaskLogEntryR\aentries\x12\x1c\n" +
|
||||
"\ttruncated\x18\x02 \x01(\bR\ttruncated\x12\x18\n" +
|
||||
@@ -15104,7 +15137,9 @@ const file_state_v1_state_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"components\x18\x05 \x03(\tR\n" +
|
||||
"components\x12\x12\n" +
|
||||
"\x04file\x18\x06 \x01(\tR\x04file\"P\n" +
|
||||
"\x04file\x18\x06 \x01(\tR\x04file\x12%\n" +
|
||||
"\x0emore_available\x18\a \x01(\bR\rmoreAvailable\x12\x16\n" +
|
||||
"\x06cursor\x18\b \x01(\x03R\x06cursor\"P\n" +
|
||||
"\x1bStreamTaskLogContentRequest\x12\x17\n" +
|
||||
"\atask_id\x18\x01 \x01(\x03R\x06taskId\x12\x18\n" +
|
||||
"\aattempt\x18\x02 \x01(\x03R\aattempt\"d\n" +
|
||||
|
||||
@@ -775,11 +775,13 @@ func (c *Client) TaskLog(ctx context.Context, taskID int64, attempt int, q loggi
|
||||
components = []string{}
|
||||
}
|
||||
return logging.TaskLogPage{
|
||||
Entries: mapValues(r.Entries, taskLogEntryValue),
|
||||
Truncated: r.Truncated,
|
||||
File: r.File,
|
||||
Found: true,
|
||||
Components: components,
|
||||
Entries: mapValues(r.Entries, taskLogEntryValue),
|
||||
Truncated: r.Truncated,
|
||||
MoreAvailable: r.MoreAvailable,
|
||||
Cursor: r.Cursor,
|
||||
File: r.File,
|
||||
Found: true,
|
||||
Components: components,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1128,12 +1128,14 @@ func (s *server) ReadTaskLog(ctx context.Context, r *pb.ReadTaskLogRequest) (*pb
|
||||
return &pb.ReadTaskLogResponse{Attempt: r.Attempt}, nil
|
||||
}
|
||||
return &pb.ReadTaskLogResponse{
|
||||
Entries: mapValues(page.Entries, taskLogEntryProto),
|
||||
Truncated: page.Truncated,
|
||||
Attempt: r.Attempt,
|
||||
Found: true,
|
||||
Components: page.Components,
|
||||
File: page.File,
|
||||
Entries: mapValues(page.Entries, taskLogEntryProto),
|
||||
Truncated: page.Truncated,
|
||||
MoreAvailable: page.MoreAvailable,
|
||||
Cursor: page.Cursor,
|
||||
Attempt: r.Attempt,
|
||||
Found: true,
|
||||
Components: page.Components,
|
||||
File: page.File,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ func taskLogRequestProto(taskID int64, attempt int, q logging.Query) *pb.ReadTas
|
||||
return &pb.ReadTaskLogRequest{
|
||||
TaskId: taskID, Attempt: int64(attempt), Limit: int64(q.Limit),
|
||||
Levels: q.Levels, Component: q.Component, Stage: q.Stage, Contains: q.Contains,
|
||||
Since: timestamp(q.Since), Until: timestamp(q.Until),
|
||||
Since: timestamp(q.Since), Until: timestamp(q.Until), BeforeId: q.BeforeID,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -674,5 +674,6 @@ func taskLogQueryValue(r *pb.ReadTaskLogRequest) logging.Query {
|
||||
Limit: int(r.Limit),
|
||||
Since: timeValue(r.Since),
|
||||
Until: timeValue(r.Until),
|
||||
BeforeID: r.BeforeId,
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,10 @@ type Query struct {
|
||||
// Both bounds are inclusive. The zero time disables its bound.
|
||||
Since time.Time
|
||||
Until time.Time
|
||||
// BeforeID is the byte-offset cursor a previous page returned as Cursor: a
|
||||
// read returns the most recent matching entries whose end offset is at or
|
||||
// before it. Zero reads the tail of the scan window.
|
||||
BeforeID int64
|
||||
}
|
||||
|
||||
// Read bounds. A log file is unbounded input, so a request must not be able to
|
||||
@@ -77,6 +81,10 @@ type Result struct {
|
||||
type TaskLogPage struct {
|
||||
Result
|
||||
Components []string `json:"components"`
|
||||
// MoreAvailable reports matching entries did not fit in this page; Cursor
|
||||
// is the byte offset to pass back as Query.BeforeID for the next older one.
|
||||
MoreAvailable bool `json:"more_available"`
|
||||
Cursor int64 `json:"cursor"`
|
||||
}
|
||||
|
||||
// ErrTaskLogsUnavailable reports that this process cannot read task logs.
|
||||
@@ -93,11 +101,16 @@ func (r *TaskRegistry) TaskLog(_ context.Context, taskID int64, attempt int, q Q
|
||||
if r == nil {
|
||||
return TaskLogPage{}, ErrTaskLogsUnavailable
|
||||
}
|
||||
res, err := Tail(TaskLogPath(r.baseDir, taskID, attempt), q)
|
||||
res, err := PageBefore(TaskLogPath(r.baseDir, taskID, attempt), q, q.BeforeID)
|
||||
if err != nil {
|
||||
return TaskLogPage{}, err
|
||||
}
|
||||
page := TaskLogPage{Result: res, Components: []string{}}
|
||||
page := TaskLogPage{
|
||||
Entries: res.Entries, Truncated: res.Truncated, File: res.File, Found: res.Found,
|
||||
Components: []string{},
|
||||
MoreAvailable: res.MoreAvailable,
|
||||
Cursor: res.Cursor,
|
||||
}
|
||||
// The filter list is a convenience: failing to build it must not cost the
|
||||
// caller their entries. Components only reads the tail this page already
|
||||
// read, so its error is the same "treat as empty" case the daemon-wide
|
||||
@@ -138,6 +151,9 @@ type PageResult struct {
|
||||
MoreAvailable bool `json:"more_available"`
|
||||
Cursor int64 `json:"cursor"`
|
||||
File string `json:"file"`
|
||||
// Found reports whether the log file exists; false with no entries is an
|
||||
// attempt with no log, not an error.
|
||||
Found bool `json:"found"`
|
||||
}
|
||||
|
||||
// logWindow is the region of a log file one read examines: the
|
||||
@@ -196,7 +212,7 @@ func readWindow(path string) (w logWindow, found bool, err error) {
|
||||
// readLines calls step for each matching entry in the last maxScanBytes of
|
||||
// path, with the offset after its line. It returns whether the window
|
||||
// excluded older data and the next cursor. Older data is never read.
|
||||
func readLines(path string, q Query, cursor int64, step func(e Entry, endOff int64) bool) (truncated bool, cursorOut int64, ok bool, err error) {
|
||||
func readLines(path string, q Query, cursor int64, step func(e Entry, startOff, endOff int64) bool) (truncated bool, cursorOut int64, ok bool, err error) {
|
||||
w, found, err := readWindow(path)
|
||||
if err != nil || !found {
|
||||
return false, 0, false, err
|
||||
@@ -236,7 +252,7 @@ func readLines(path string, q Query, cursor int64, step func(e Entry, endOff int
|
||||
// walkWindow calls step for each matching entry from offset from, skipping
|
||||
// undecodable lines, and returns the file offset to resume at. step returns
|
||||
// false to stop.
|
||||
func walkWindow(data []byte, windowStart, from int64, q Query, step func(e Entry, endOff int64) bool) int64 {
|
||||
func walkWindow(data []byte, windowStart, from int64, q Query, step func(e Entry, startOff, endOff int64) bool) int64 {
|
||||
pos := from
|
||||
for pos < int64(len(data)) {
|
||||
// lineEnd indexes the line's terminating '\n'; when the final
|
||||
@@ -253,7 +269,7 @@ func walkWindow(data []byte, windowStart, from int64, q Query, step func(e Entry
|
||||
if len(raw) > 0 && raw[len(raw)-1] == '\r' {
|
||||
raw = raw[:len(raw)-1] // CRLF
|
||||
}
|
||||
if entry, decoded := decode(raw); decoded && q.matches(entry) && !step(entry, endOff) {
|
||||
if entry, decoded := decode(raw); decoded && q.matches(entry) && !step(entry, windowStart+pos, endOff) {
|
||||
return endOff
|
||||
}
|
||||
if nl < 0 {
|
||||
@@ -287,7 +303,7 @@ func Tail(path string, q Query) (Result, error) {
|
||||
}
|
||||
|
||||
matches := make([]Entry, 0, limit)
|
||||
truncated, _, ok, err := readLines(path, q, 0, func(e Entry, _ int64) bool {
|
||||
truncated, _, ok, err := readLines(path, q, 0, func(e Entry, _, _ int64) bool {
|
||||
if len(matches) == limit {
|
||||
matches = append(matches[:0], matches[1:]...)
|
||||
res.Truncated = true
|
||||
@@ -321,12 +337,22 @@ func Page(path string, q Query, cursor int64) (PageResult, error) {
|
||||
limit = MaxTailLines
|
||||
}
|
||||
|
||||
// Stat for Found without reading the window twice. readLines cannot report
|
||||
// the difference between a missing file and a cursor at EOF.
|
||||
if strings.TrimSpace(path) != "" {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
res.Found = true
|
||||
} else if !os.IsNotExist(err) {
|
||||
return PageResult{}, fmt.Errorf("logging: stat %s: %w", path, err)
|
||||
}
|
||||
}
|
||||
|
||||
type lineAt struct {
|
||||
entry Entry
|
||||
endOff int64
|
||||
}
|
||||
matches := make([]lineAt, 0, limit)
|
||||
truncated, endOff, ok, err := readLines(path, q, cursor, func(e Entry, end int64) bool {
|
||||
truncated, endOff, ok, err := readLines(path, q, cursor, func(e Entry, _, end int64) bool {
|
||||
if len(matches) < limit {
|
||||
matches = append(matches, lineAt{entry: e, endOff: end})
|
||||
return true
|
||||
@@ -362,6 +388,70 @@ func Page(path string, q Query, cursor int64) (PageResult, error) {
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// PageBefore returns up to Limit matching entries whose end offset is at or
|
||||
// before before (the whole scan window when before is zero), oldest first. It
|
||||
// is the backward counterpart of Page: Cursor is the before value for the next
|
||||
// older page, and MoreAvailable reports older matches beyond this page.
|
||||
func PageBefore(path string, q Query, before int64) (PageResult, error) {
|
||||
res := PageResult{Entries: []Entry{}, File: path}
|
||||
limit := q.Limit
|
||||
if limit <= 0 {
|
||||
limit = DefaultTailLines
|
||||
}
|
||||
if limit > MaxTailLines {
|
||||
limit = MaxTailLines
|
||||
}
|
||||
|
||||
// Stat for Found without reading the window twice. readLines cannot report
|
||||
// the difference between a missing file and a cursor at EOF.
|
||||
if strings.TrimSpace(path) != "" {
|
||||
if _, err := os.Stat(path); err == nil {
|
||||
res.Found = true
|
||||
} else if !os.IsNotExist(err) {
|
||||
return PageResult{}, fmt.Errorf("logging: stat %s: %w", path, err)
|
||||
}
|
||||
}
|
||||
|
||||
type lineAt struct {
|
||||
entry Entry
|
||||
start, end int64
|
||||
}
|
||||
matches := make([]lineAt, 0, limit)
|
||||
truncated, _, ok, err := readLines(path, q, 0, func(e Entry, start, end int64) bool {
|
||||
// File order is oldest to newest: once past the bound, nothing older
|
||||
// follows.
|
||||
if before > 0 && end > before {
|
||||
return false
|
||||
}
|
||||
if len(matches) == limit {
|
||||
// Drop the oldest so the page holds the limit entries closest to
|
||||
// before, and remember older entries exist beyond it.
|
||||
matches = append(matches[:0], matches[1:]...)
|
||||
res.MoreAvailable = true
|
||||
}
|
||||
matches = append(matches, lineAt{entry: e, start: start, end: end})
|
||||
return true
|
||||
})
|
||||
if err != nil {
|
||||
return PageResult{}, err
|
||||
}
|
||||
if !ok {
|
||||
res.Truncated = truncated
|
||||
return res, nil
|
||||
}
|
||||
res.Truncated = truncated
|
||||
res.Entries = make([]Entry, len(matches))
|
||||
for i, m := range matches {
|
||||
res.Entries[i] = m.entry
|
||||
}
|
||||
// The oldest returned entry's start is the before value that returns the
|
||||
// entries strictly older than this page. No matches means no older page.
|
||||
if len(matches) > 0 {
|
||||
res.Cursor = matches[0].start
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
|
||||
// decode parses one slog JSON line, lifting the known keys out and keeping the
|
||||
// rest as structured fields. A line that is not JSON is skipped: a log file may
|
||||
// contain output from a subprocess that does not share our format.
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/samcharles93/archie-core/internal/logging"
|
||||
)
|
||||
@@ -29,6 +30,18 @@ func (s *Server) handleTaskLogs(w http.ResponseWriter, r *http.Request) {
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
beforeID, ok := taskLogBeforeID(w, q.Get("before"))
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
since, ok := taskLogTime(w, "since", q.Get("since"))
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
until, ok := taskLogTime(w, "until", q.Get("until"))
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
page, err := reader.TaskLog(r.Context(), id, attempt, logging.Query{
|
||||
Levels: splitCSV(q.Get("level")),
|
||||
Component: strings.TrimSpace(q.Get("component")),
|
||||
@@ -38,6 +51,9 @@ func (s *Server) handleTaskLogs(w http.ResponseWriter, r *http.Request) {
|
||||
Stage: strings.TrimSpace(q.Get("stage")),
|
||||
Contains: strings.TrimSpace(q.Get("q")),
|
||||
Limit: limit,
|
||||
BeforeID: beforeID,
|
||||
Since: since,
|
||||
Until: until,
|
||||
})
|
||||
if err != nil {
|
||||
// A reader that exists but cannot read here is still a statement about
|
||||
@@ -52,11 +68,13 @@ func (s *Server) handleTaskLogs(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
writeJSON(w, map[string]any{
|
||||
"entries": page.Entries,
|
||||
"truncated": page.Truncated,
|
||||
"file": page.File,
|
||||
"components": page.Components,
|
||||
"attempt": attempt,
|
||||
"entries": page.Entries,
|
||||
"truncated": page.Truncated,
|
||||
"more_available": page.MoreAvailable,
|
||||
"cursor": page.Cursor,
|
||||
"file": page.File,
|
||||
"components": page.Components,
|
||||
"attempt": attempt,
|
||||
// found is the distinction the page needs: a reader answering with no
|
||||
// entries because the file is absent is not a reader that is absent.
|
||||
"found": page.Found,
|
||||
@@ -138,6 +156,35 @@ func taskLogLimit(w http.ResponseWriter, raw string) (int, bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// taskLogBeforeID parses the byte-offset cursor a previous page returned: the
|
||||
// read returns the entries older than it.
|
||||
func taskLogBeforeID(w http.ResponseWriter, raw string) (int64, bool) {
|
||||
raw = strings.TrimSpace(raw)
|
||||
if raw == "" {
|
||||
return 0, true
|
||||
}
|
||||
parsed, err := strconv.ParseInt(raw, 10, 64)
|
||||
if err != nil || parsed < 0 {
|
||||
http.Error(w, "bad before", http.StatusBadRequest)
|
||||
return 0, false
|
||||
}
|
||||
return parsed, true
|
||||
}
|
||||
|
||||
// taskLogTime parses an RFC 3339 time bound; empty disables it.
|
||||
func taskLogTime(w http.ResponseWriter, name, raw string) (time.Time, bool) {
|
||||
raw = strings.TrimSpace(raw)
|
||||
if raw == "" {
|
||||
return time.Time{}, true
|
||||
}
|
||||
parsed, err := time.Parse(time.RFC3339, raw)
|
||||
if err != nil {
|
||||
http.Error(w, "bad "+name, http.StatusBadRequest)
|
||||
return time.Time{}, false
|
||||
}
|
||||
return parsed, true
|
||||
}
|
||||
|
||||
// writeDisabledTaskLogs is the "this process cannot read task logs" answer,
|
||||
// the same convention handleLogs uses for the daemon-wide log: an optional
|
||||
// capability that is absent here must not turn "why did this task park?" into
|
||||
|
||||
@@ -1012,6 +1012,10 @@ message ReadTaskLogRequest {
|
||||
// tagged carry one -- agent and tool output is logged without a stage, so a
|
||||
// stage filter narrows the file rather than covering it. Empty means any.
|
||||
string stage = 9;
|
||||
// before_id is the byte-offset cursor a previous page returned as cursor: the
|
||||
// read returns the most recent matching entries ending at or before it. Zero
|
||||
// reads the tail, which is the page the dashboard opens on.
|
||||
int64 before_id = 10;
|
||||
}
|
||||
// found=false is not an error: the task has no log file for that attempt.
|
||||
// That is a different condition from a process that cannot read logs at all
|
||||
@@ -1026,6 +1030,12 @@ message ReadTaskLogResponse {
|
||||
// is the state directory's own layout, reported to an already-authenticated
|
||||
// operator; no caller is expected to open it.
|
||||
string file = 6;
|
||||
// more_available reports matching entries did not fit in this page; cursor
|
||||
// is the before_id for the next older one. truncated is separate: it means
|
||||
// the log is larger than the readable scan window, so its oldest entries
|
||||
// cannot be reached by paging at all.
|
||||
bool more_available = 7;
|
||||
int64 cursor = 8;
|
||||
}
|
||||
|
||||
// StreamTaskLogContent returns one attempt's log verbatim, for a download. The
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--twLine truncated
|
||||
.vue-flow{z-index:0;direction:ltr;width:100%;height:100%;position:relative;overflow:hidden}.vue-flow__container{width:100%;height:100%;position:absolute;top:0;left:0}.vue-flow__pane{z-index:1}.vue-flow__pane.draggable{cursor:grab}.vue-flow__pane.selection{cursor:pointer}.vue-flow__pane.dragging{cursor:grabbing}.vue-flow__transformationpane{transform-origin:0 0;z-index:2;pointer-events:none}.vue-flow__viewport{z-index:4;overflow:clip}.vue-flow__selection{z-index:6}.vue-flow__edge-labels{pointer-events:none;-webkit-user-select:none;user-select:none;width:100%;height:100%;position:absolute}.vue-flow__nodesselection-rect:focus,.vue-flow__nodesselection-rect:focus-visible{outline:none}.vue-flow .vue-flow__edges{pointer-events:none;overflow:visible}.vue-flow__edge-path,.vue-flow__connection-path{stroke:#b1b1b7;stroke-width:1px;fill:none}.vue-flow__edge{pointer-events:visibleStroke;cursor:pointer}.vue-flow__edge.animated path{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__edge.animated path.vue-flow__edge-interaction{stroke-dasharray:none;animation:none}.vue-flow__edge.inactive{pointer-events:none}.vue-flow__edge.selected,.vue-flow__edge:focus,.vue-flow__edge:focus-visible{outline:none}.vue-flow__edge.selected .vue-flow__edge-path,.vue-flow__edge:focus .vue-flow__edge-path,.vue-flow__edge:focus-visible .vue-flow__edge-path{stroke:#555}.vue-flow__edge-textwrapper{pointer-events:all}.vue-flow__edge-textbg{fill:#fff}.vue-flow__edge-text{pointer-events:none;-webkit-user-select:none;user-select:none}.vue-flow__connection{pointer-events:none}.vue-flow__connection .animated{stroke-dasharray:5;animation:.5s linear infinite dashdraw}.vue-flow__connectionline{z-index:1001}.vue-flow__nodes{pointer-events:none;transform-origin:0 0}.vue-flow__node{-webkit-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default;position:absolute}.vue-flow__node.draggable{cursor:grab;pointer-events:all}.vue-flow__node.draggable.dragging{cursor:grabbing}.vue-flow__nodesselection{z-index:3;transform-origin:0 0;pointer-events:none}.vue-flow__nodesselection-rect{pointer-events:all;cursor:grab;position:absolute}.vue-flow__nodesselection-rect.dragging{cursor:grabbing}.vue-flow__handle{pointer-events:none;min-width:5px;min-height:5px;position:absolute}.vue-flow__handle.connectable{pointer-events:all;cursor:crosshair}.vue-flow__handle-bottom{bottom:0;left:50%;transform:translate(-50%,50%)}.vue-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.vue-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.vue-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.vue-flow__edgeupdater{cursor:move;pointer-events:all}.vue-flow__panel{z-index:5;margin:15px;position:absolute}.vue-flow__panel.top{top:0}.vue-flow__panel.bottom{bottom:0}.vue-flow__panel.left{left:0}.vue-flow__panel.right{right:0}.vue-flow__panel.center{left:50%;transform:translate(-50%)}@keyframes dashdraw{0%{stroke-dashoffset:10px}}.vue-flow__controls{box-shadow:0 0 2px 1px #00000014}.vue-flow__controls-button{box-sizing:content-box;cursor:pointer;-webkit-user-select:none;user-select:none;background:#fefefe;border:none;border-bottom:1px solid #eee;justify-content:center;align-items:center;width:16px;height:16px;padding:5px;display:flex}.vue-flow__controls-button svg{width:100%;max-width:12px;max-height:12px}.vue-flow__controls-button:hover{background:#f4f4f4}.vue-flow__controls-button:disabled{pointer-events:none}.vue-flow__controls-button:disabled svg{fill-opacity:.4}.workflow-flow-edge path{stroke:var(--color-muted-foreground);stroke-width:1.5px}.workflow-data-edge path{stroke:var(--color-primary);stroke-dasharray:5 4;stroke-width:1.25px}@keyframes step-running{50%{box-shadow:0 0 0 4px color-mix(in oklab, var(--color-info) 30%, transparent)}}.step-running{animation:1.6s ease-in-out infinite step-running}.workflow-canvas .vue-flow__controls{box-shadow:none}.workflow-canvas .vue-flow__controls-button{background:var(--color-card);border-color:var(--color-border);fill:var(--color-foreground)}.workflow-canvas .vue-flow__controls-button:hover{background:var(--color-secondary)}@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){:root,:host{--shimmer-angle:20deg}*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--twLine truncated
|
||||
Vendored
+61
-61
@@ -1,74 +1,74 @@
|
||||
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HarnessPage.js","assets/HarnessPage.css"])))=>i.map(i=>d[i]);
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
|
||||
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function n(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var r={},i=[],a=()=>{},o=()=>!1,s=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),c=e=>e.startsWith(`onUpdate:`),l=Object.assign,u=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,f=(e,t)=>d.call(e,t),p=Array.isArray,m=e=>w(e)===`[object Map]`,h=e=>w(e)===`[object Set]`,g=e=>w(e)===`[object Date]`,_=e=>w(e)===`[object RegExp]`,v=e=>typeof e==`function`,y=e=>typeof e==`string`,b=e=>typeof e==`symbol`,x=e=>typeof e==`object`&&!!e,S=e=>(x(e)||v(e))&&v(e.then)&&v(e.catch),C=Object.prototype.toString,w=e=>C.call(e),T=e=>w(e).slice(8,-1),E=e=>w(e)===`[object Object]`,D=e=>y(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,O=n(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,k=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,re=ee(e=>e.replace(ne,`-$1`).toLowerCase()),ie=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ae=ee(e=>e?`on${ie(e)}`:``),A=(e,t)=>!Object.is(e,t),oe=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},se=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ce=e=>{let t=parseFloat(e);return isNaN(t)?e:t},le=e=>{let t=y(e)?Number(e):NaN;return isNaN(t)?e:t},ue,de=()=>ue||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{},fe=n(`Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol`);function pe(e){if(p(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=y(r)?_e(r):pe(r);if(i)for(let e in i)t[e]=i[e]}return t}if(y(e)||x(e))return e}var me=/;(?![^(]*\))/g,he=/:([^]+)/,ge=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function _e(e){let t={};return e.replace(ge,e=>e.startsWith(`/*`)?``:e).split(me).forEach(e=>{if(e){let n=e.split(he);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function j(e){let t=``;if(y(e))t=e;else if(p(e))for(let n=0;n<e.length;n++){let r=j(e[n]);r&&(t+=r+` `)}else if(x(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}function ve(e){if(!e)return null;let{class:t,style:n}=e;return t&&!y(t)&&(e.class=j(t)),n&&(e.style=pe(n)),e}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=n(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Ee(e[i],t[i],n);return r}function Ce(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Ee(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function we(e,t,n){let r=m(e),i=m(t);if(r||i||(r=h(e),i=h(t),r||i))return r&&i?Ce(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Ee(e[r],t[r],n))return!1}return String(e)===String(t)}function Te(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Ee(e,t,n){if(e===t)return!0;let r=g(e),i=g(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=b(e),i=b(t),r||i?e===t:(r=p(e),i=p(t),r||i?r&&i?Te(e,t,n,Se):!1:(r=x(e),i=x(t),r||i?!r||!i?!1:Te(e,t,n,we):String(e)===String(t))))}function De(e,t){return e.findIndex(e=>Ee(e,t))}var Oe=e=>!!(e&&e.__v_isRef===!0),M=e=>y(e)?e:e==null?``:p(e)||x(e)&&(e.toString===C||!v(e.toString))?Oe(e)?M(e.value):JSON.stringify(e,ke,2):String(e),ke=(e,t)=>Oe(t)?ke(e,t.value):m(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Ae(t,r)+` =>`]=n,e),{})}:h(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Ae(e))}:b(t)?Ae(t):x(t)&&!p(t)&&!E(t)?String(t):t,Ae=(e,t=``)=>b(e)?`Symbol(${e.description??t})`:e;function je(e){return e==null?`initial`:typeof eLine truncated
|
||||
`&&(e.tagName===`PRE`||e.tagName===`TEXTAREA`)&&(n=n.slice(1));let{textContent:r}=e;r!==n&&r!==n.replace(/\r\n|\r/g,`
|
||||
`)&&(mi(e,0)||ii(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(di(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&$t(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&hs(x,n,t),h&&lr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Go(()=>{x&&hs(x,n,t),l&&g.enter(e),h&&lr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=fs(d[t]),g=h.type===Jo;e?(g&&!u&&t+1<p&&fs(d[t+1]).type===Jo&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,mi(r,1)||ii()),n(null,h,r,null,o,s,si(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&ci(f)&&f.data===`]`?a(t.anchor=f):(ii(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(gi(e,t)||ii(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,si(d),s),r&&(r.vnode.el=t.el,ro(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&ci(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var ui=new Set([`src`,`srcset`,`href`,`poster`]);function di(e,t,n){return ui.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var fi=`data-allow-mismatch`,pi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function mi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(fi);)e=e.parentElement;return hi(e&&e.getAttribute(fi),t)}function hi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(pi[t])}}function gi(e,t){return mi(e.parentElement,1)||_i(e)||vi(t)}function _i(e){return e.nodeType===1&&hi(e.getAttribute(fi),1)}function vi({props:e}){let t=e&&e[fi];return typeof t==`string`&&hi(t,1)}var yi=de().requestIdleCallback||(e=>setTimeout(e,1)),bi=de().cancelIdleCallback||(e=>clearTimeout(e)),xi=(e=1e4)=>t=>{let n=yi(t,{timeout:e});return()=>bi(n)};function Si(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Ci=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(Si(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},wi=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},Ti=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ei(e,t){if(ci(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(ci(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Di=e=>!!e.type.__asyncLoader;function Oi(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ei(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=ys;if(Zr(e),u)return()=>ki(u,e);let t=t=>{l=null,Rn(t,e,13,!r)};if(s&&e.suspense||Es)return p().then(t=>()=>ki(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Ki(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&Ai(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return ki(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d
Line truncated
|
||||
`))),e[Dl]=wl(i);let a=r||i.props&&i.props.type===`number`;Gc(e,t?`change`:`input`,t=>{t.target.composing||e[Dl](kl(e.value,n,a))}),(n||a)&&Gc(e,`change`,()=>{e.value=kl(e.value,n,a)}),t||(Gc(e,`compositionstart`,Tl),Gc(e,`compositionend`,El),Gc(e,`change`,El))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Ol];delete e[Ol],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[Dl](kl(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Dl]=wl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},jl={deep:!0,created(e,t,n){e[Dl]=wl(n),Gc(e,`change`,()=>{let t=e._modelValue,n=Il(e),r=e.checked,i=e[Dl];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Ll(e,r))})},mounted:Ml,beforeUpdate(e,t,n){e[Dl]=wl(n),Ml(e,t,n)}};function Ml(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Ll(e,!0))}e.checked!==i&&(e.checked=i)}var Nl={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[Dl]=wl(n),Gc(e,`change`,()=>{e[Dl](Il(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Dl]=wl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Pl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Gc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Il(e)):Il(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[Dl](i)}finally{qn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Dl]=wl(r)},mounted(e,{value:t}){Fl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Dl]=wl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!pee(t,n[1],n[0]))&&Fl(e,t)}};function pee(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Fl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Il(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(Il(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Il(e){return`_value`in e?e._value:e.value}function Ll(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Rl={created(e,t,n){Bl(e,t,n,null,`created`)},mounted(e,t,n){Bl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){Bl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){Bl(e,t,n,r,`updated`)}};function zl(e,t){switch(e){case`SELECT`:return Pl;case`TEXTAREA`:return Al;default:switch(t){case`checkbox`:return jl;case`radio`:return Nl;default:return Al}}}function Bl(e,t,n,r,i){let a=zl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function mee(){Al.getSSRProps=({value:e})=>({value:e}),Nl.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},jl.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Rl.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=zl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var hee=[`ctrl`,`shift`,`alt`,`meta`],gee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>hee.some(n=>e[`${n}Key`]&&!t.includes(n))},Vl=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=gee[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},_ee={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Hl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||_ee[e]===r))return e(n)}))},Ul=l({patchProp:rl},rc),Wl,Gl=!1;function Kl(){return Wl||=wo(Ul)}function ql(){return Wl=Gl?Wl:To(Ul),Gl=!0,Wl}var Jl=((...e)=>{Kl().render(...e)}),Yl=((...e)=>{ql().hydrate(...e)}),Xl=((...e)=>{let t=Kl().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=$l(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Ql(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Lp;function Rp(e){Lp=e}var zp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function Bp(e){let t=e instanceof zp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Vp(e,t){let n=await fetch(e,t);if(Lp?.(n.status===401),!n.ok)throw new zp(await Ip(n),n.status);return n}async function Hp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Pp,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Vp(e,s);return a?await c.json():void 0}var Z={health:()=>Hp(`/health/detailed`),services:()=>Hp(`/api/services`),policies:()=>Hp(`/api/access/policies`),putPolicy:e=>Hp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Hp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>Hp(`/api/orgs`),org:e=>Hp(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Hp(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Hp(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>Hp(`/api/orgs/${encodeURIComponent(e)}/members`),setOrgMember:(e,t,n)=>Hp(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Hp(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Fp({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Hp(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),summary:()=>Hp(`/api/summary`),tasks:()=>Hp(`/api/tasks`),taskPage:async e=>{let t=await Vp(`/api/tasks`+Fp(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Pp)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Hp(`/api/task-meta`),task:e=>Hp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Hp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/changes`+Fp(t)),taskDebug:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/debug`+Fp(t)),taskAction:(e,t,n)=>Hp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Hp(`/api/setup`),capabilities:()=>Hp(`/api/capabilities`),workflows:()=>Hp(`/api/workflows`),workflowEnabled:(e,t)=>Hp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Hp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Hp(`/api/skills`),channels:()=>Hp(`/api/channels`),curators:()=>Hp(`/api/curators`),channelReload:e=>Hp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Hp(`/api/config`),logs:e=>Hp(`/api/logs`+Fp(e)),taskLogs:(e,t)=>Hp(`/api/tasks/${encodeURIComponent(e)}/logs`+Fp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Hp(`/api/version`),updateSnapshot:()=>Hp(`/api/chat/update`),updateInstall:e=>Hp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Hp(`/api/captures`+Fp({limit:e})),eventTypes:()=>Hp(`/api/event-types`),eventTypeCreate:e=>Hp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Hp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Hp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Hp(`/api/mappings`),mappingCreate:e=>Hp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Hp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Hp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Hp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Hp(`/api/bindings`),dispatches:(e,t)=>Hp(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>Hp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Hp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Hp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Hp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>Hp(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>Hp(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>Hp(`/api/harness/bindings`),sources:()=>Hp(`/api/sources`),sourceCreate:e=>Hp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Hp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Hp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Hp
Line truncated
|
||||
`)&&(pi(e,0)||ri(),e.textContent=t.children)}if(d){if(_||b||!o||f&48){let t=e.tagName.includes(`-`),i=e.namespaceURI.includes(`svg`)?`svg`:e.namespaceURI.includes(`MathML`)?`mathml`:void 0;for(let a in d)if(_&&(a.endsWith(`value`)||a===`indeterminate`)||s(a)&&!O(a)||a[0]===`.`||t&&!O(a)||u&&u.includes(a)){if(ui(e,a,d[a]))continue;r(e,a,null,d[a],i,n)}}else if(d.onClick)r(e,`onClick`,null,d.onClick,void 0,n);else if(f&4&&$t(d.style))for(let e in d.style)d.style[e]}let x;(x=d&&d.onVnodeBeforeMount)&&ms(x,n,t),h&&lr(t,null,n,`beforeMount`),((x=d&&d.onVnodeMounted)||h||l)&&Wo(()=>{x&&ms(x,n,t),l&&g.enter(e),h&&lr(t,null,n,`mounted`)},i)}return e.nextSibling},m=(e,t,r,o,s,c,u)=>{u||=!!t.dynamicChildren;let d=t.children,p=d.length,m=!1;for(let t=0;t<p;t++){let h=u?d[t]:d[t]=ds(d[t]),g=h.type===qo;e?(g&&!u&&t+1<p&&ds(d[t+1]).type===qo&&(l(i(e.data.slice(h.children.length)),r,a(e)),e.data=h.children),e=f(e,h,o,s,c,u)):g&&!h.children?l(h.el=i(``),r):(m||(m=!0,pi(r,1)||ri()),n(null,h,r,null,o,s,oi(r),c))}return e},h=(e,t,n,r,i,s)=>{let{slotScopeIds:c}=t;c&&(i=i?i.concat(c):c);let d=o(e),f=m(a(e),t,d,n,r,i,s);return f&&si(f)&&f.data===`]`?a(t.anchor=f):(ri(),l(t.anchor=u(`]`),d,f),f)},g=(e,t,r,i,s,l)=>{if(hi(e,t)||ri(),t.el=null,l){let t=_(e);for(;;){let n=a(e);if(n&&n!==t)c(n);else break}}let u=a(e),d=o(e);return c(e),n(null,t,d,u,r,i,oi(d),s),r&&(r.vnode.el=t.el,no(r,t.el)),u},_=(e,t=`[`,n=`]`)=>{let r=0;for(;e;)if(e=a(e),e&&si(e)&&(e.data===t&&r++,e.data===n)){if(r===0)return a(e);r--}return e},v=(e,t,n)=>{let r=t.parentNode;r&&r.replaceChild(e,t);let i=n;for(;i;)i.vnode.el===t&&(i.vnode.el=i.subTree.el=e),i=i.parent},y=e=>e.nodeType===1&&e.tagName===`TEMPLATE`;return[d,f]}var li=new Set([`src`,`srcset`,`href`,`poster`]);function ui(e,t,n){return li.has(t)?e.getAttribute(t)===(n==null?null:`${n}`):!1}var di=`data-allow-mismatch`,fi={0:`text`,1:`children`,2:`class`,3:`style`,4:`attribute`};function pi(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(di);)e=e.parentElement;return mi(e&&e.getAttribute(di),t)}function mi(e,t){if(e==null)return!1;if(e===``)return!0;{let n=e.split(`,`);return t===0&&n.includes(`children`)?!0:n.includes(fi[t])}}function hi(e,t){return pi(e.parentElement,1)||gi(e)||_i(t)}function gi(e){return e.nodeType===1&&mi(e.getAttribute(di),1)}function _i({props:e}){let t=e&&e[di];return typeof t==`string`&&mi(t,1)}var vi=de().requestIdleCallback||(e=>setTimeout(e,1)),yi=de().cancelIdleCallback||(e=>clearTimeout(e)),bi=(e=1e4)=>t=>{let n=vi(t,{timeout:e});return()=>yi(n)};function xi(e){let{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:a,innerWidth:o}=window;return(t>0&&t<a||r>0&&r<a)&&(n>0&&n<o||i>0&&i<o)}var Si=e=>(t,n)=>{let r=new IntersectionObserver(e=>{for(let n of e)if(n.isIntersecting){r.disconnect(),t();break}},e);return n(e=>{if(e instanceof Element){if(xi(e))return t(),r.disconnect(),!1;r.observe(e)}}),()=>r.disconnect()},Ci=e=>t=>{if(e){let n=matchMedia(e);if(n.matches)t();else return n.addEventListener(`change`,t,{once:!0}),()=>n.removeEventListener(`change`,t)}},wi=(e=[])=>(t,n)=>{y(e)&&(e=[e]);let r=!1,i=e=>{r||(r=!0,a(),t(),e.target.dispatchEvent(new e.constructor(e.type,e)))},a=()=>{n(t=>{for(let n of e)t.removeEventListener(n,i)})};return n(t=>{for(let n of e)t.addEventListener(n,i,{once:!0})}),a};function Ti(e,t){if(si(e)&&e.data===`[`){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(si(r)){if(r.data===`]`){if(--n===0)break}else r.data===`[`&&n++}r=r.nextSibling}}else t(e)}var Ei=e=>!!e.type.__asyncLoader;function Di(e){v(e)&&(e={loader:e});let{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:a,timeout:o,suspensible:s=!0,onError:c}=e,l=null,u,d=0,f=()=>(d++,l=null,p()),p=()=>{let e;return l||(e=l=t().catch(e=>{if(e=e instanceof Error?e:Error(String(e)),c)return new Promise((t,n)=>{c(e,()=>t(f()),()=>n(e),d+1)});throw e}).then(t=>e!==l&&l?l:(t&&(t.__esModule||t[Symbol.toStringTag]===`Module`)&&(t=t.default),u=t,t)))};return L({name:`AsyncComponentWrapper`,__asyncLoader:p,__asyncHydrate(e,t,n){let r=e.isConnected,i=!1;(t.bu||=[]).push(()=>i=!0);let o=()=>{i||!e.parentNode||r&&!e.isConnected||n()},s=a?()=>{let n=a(o,t=>Ti(e,t));n&&(t.bum||=[]).push(n)}:o;u?s():p().then(()=>!t.isUnmounted&&s())},get __asyncResolved(){return u},setup(){let e=vs;if(Xr(e),u)return()=>Oi(u,e);let t=t=>{l=null,Rn(t,e,13,!r)};if(s&&e.suspense||Ts)return p().then(t=>()=>Oi(t,e)).catch(e=>(t(e),()=>r?G(r,{error:e}):null));let a=N(!1),c=N(),d=N(!!i),f,m;return Gi(()=>{f!=null&&clearTimeout(f),m!=null&&clearTimeout(m)}),i&&(m=setTimeout(()=>{e.isUnmounted||(d.value=!1)},i)),o!=null&&(f=setTimeout(()=>{if(!e.isUnmounted&&!a.value&&!c.value){let e=Error(`Async component timed out after ${o}ms.`);t(e),c.value=e}},o)),p().then(()=>{e.isUnmounted||(a.value=!0,e.parent&&ki(e.parent.vnode)&&e.parent.update())}).catch(n=>{if(e.isUnmounted){l=null;return}t(n),c.value=n}),()=>{if(a.value&&u)return Oi(u,e);if(c.value&&r)return G(r,{error:c.value});if(n&&!d
Line truncated
|
||||
`))),e[El]=Cl(i);let a=r||i.props&&i.props.type===`number`;Wc(e,t?`change`:`input`,t=>{t.target.composing||e[El](Ol(e.value,n,a))}),(n||a)&&Wc(e,`change`,()=>{e.value=Ol(e.value,n,a)}),t||(Wc(e,`compositionstart`,wl),Wc(e,`compositionend`,Tl),Wc(e,`change`,Tl))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[Dl];delete e[Dl],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[El](Ol(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[El]=Cl(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?ce(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},Al={deep:!0,created(e,t,n){e[El]=Cl(n),Wc(e,`change`,()=>{let t=e._modelValue,n=Fl(e),r=e.checked,i=e[El];if(p(t)){let e=De(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(h(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(Il(e,r))})},mounted:jl,beforeUpdate(e,t,n){e[El]=Cl(n),jl(e,t,n)}};function jl(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=De(t,r.props.value)>-1;else if(h(t))i=t.has(r.props.value);else{if(t===n)return;i=Ee(t,Il(e,!0))}e.checked!==i&&(e.checked=i)}var Ml={created(e,{value:t},n){e.checked=Ee(t,n.props.value),e[El]=Cl(n),Wc(e,`change`,()=>{e[El](Fl(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[El]=Cl(r),t!==n&&(e.checked=Ee(t,r.props.value))}},Nl={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Wc(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?ce(Fl(e)):Fl(e)),r=e.multiple,i=r?h(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?p(i)?t.slice():t:i];try{e[El](i)}finally{qn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[El]=Cl(r)},mounted(e,{value:t}){Pl(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[El]=Cl(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!mee(t,n[1],n[0]))&&Pl(e,t)}};function mee(e,t,n){if(!n||p(e))return Ee(e,t);if(h(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Pl(e,t){let n=e.multiple,r=p(t);if(!n||r||h(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=Fl(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):De(t,o)>-1}else a.selected=t.has(o)}else if(Ee(Fl(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Fl(e){return`_value`in e?e._value:e.value}function Il(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var Ll={created(e,t,n){zl(e,t,n,null,`created`)},mounted(e,t,n){zl(e,t,n,null,`mounted`)},beforeUpdate(e,t,n,r){zl(e,t,n,r,`beforeUpdate`)},updated(e,t,n,r){zl(e,t,n,r,`updated`)}};function Rl(e,t){switch(e){case`SELECT`:return Nl;case`TEXTAREA`:return kl;default:switch(t){case`checkbox`:return Al;case`radio`:return Ml;default:return kl}}}function zl(e,t,n,r,i){let a=Rl(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function hee(){kl.getSSRProps=({value:e})=>({value:e}),Ml.getSSRProps=({value:e},t)=>{if(t.props&&Ee(t.props.value,e))return{checked:!0}},Al.getSSRProps=({value:e},t)=>{if(p(e)){if(t.props&&De(e,t.props.value)>-1)return{checked:!0}}else if(h(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},Ll.getSSRProps=(e,t)=>{if(typeof t.type!=`string`)return;let n=Rl(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}var gee=[`ctrl`,`shift`,`alt`,`meta`],_ee={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>gee.some(n=>e[`${n}Key`]&&!t.includes(n))},Bl=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=_ee[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},vee={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Vl=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=re(n.key);if(t.some(e=>e===r||vee[e]===r))return e(n)}))},Hl=l({patchProp:nl},nc),Ul,Wl=!1;function Gl(){return Ul||=Co(Hl)}function Kl(){return Ul=Wl?Ul:wo(Hl),Wl=!0,Ul}var ql=((...e)=>{Gl().render(...e)}),Jl=((...e)=>{Kl().hydrate(...e)}),Yl=((...e)=>{let t=Gl().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ql(e);if(!r)return;let i=t._component;!v(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Zl(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},
Line truncated
|
||||
`)[0].slice(0,200)}catch{}return`${e.status} ${e.statusText}`}var Ip;function Lp(e){Ip=e}var Rp=class extends Error{status;constructor(e,t){super(e),this.name=`ApiError`,this.status=t}};function zp(e){let t=e instanceof Rp?e.status:void 0,n=e instanceof Error&&e.message?e.message:`Action failed`;return t===401?{kind:`session-expired`,message:n}:t!==void 0&&t>=400&&t<500?{kind:`refused`,message:n}:{kind:`broken`,message:n}}async function Bp(e,t){let n=await fetch(e,t);if(Ip?.(n.status===401),!n.ok)throw new Rp(await Fp(n),n.status);return n}async function Vp(e,t={}){let{method:n=`GET`,body:r,timeoutMs:i=Np,parse:a=!0}=t,o={Accept:`application/json`},s={method:n,headers:o,signal:AbortSignal.timeout(i)};n!==`GET`&&(o[`Content-Type`]=`application/json`,o[`X-Archie-CSRF`]=`1`),r!==void 0&&(s.body=JSON.stringify(r));let c=await Bp(e,s);return a?await c.json():void 0}var Z={health:()=>Vp(`/health/detailed`),services:()=>Vp(`/api/services`),policies:()=>Vp(`/api/access/policies`),putPolicy:e=>Vp(`/api/access/policies`,{method:`PUT`,body:e}),deletePolicy:e=>Vp(`/api/access/policies`,{method:`DELETE`,body:e,parse:!1}),orgs:()=>Vp(`/api/orgs`),org:e=>Vp(`/api/orgs/${encodeURIComponent(e)}`),orgWorkspaces:e=>Vp(`/api/orgs/${encodeURIComponent(e)}/workspaces`),createOrgWorkspace:(e,t)=>Vp(`/api/orgs/${encodeURIComponent(e)}/workspaces`,{method:`POST`,body:t}),orgMembers:e=>Vp(`/api/orgs/${encodeURIComponent(e)}/members`),setOrgMember:(e,t,n)=>Vp(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PUT`,body:n}),removeOrgMember:(e,t,n)=>Vp(`/api/orgs/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`+Pp({workspace:n}),{method:`DELETE`,parse:!1}),assignOrgAgent:(e,t)=>Vp(`/api/orgs/${encodeURIComponent(e)}/agents/${encodeURIComponent(t)}`,{method:`PUT`}),summary:()=>Vp(`/api/summary`),tasks:()=>Vp(`/api/tasks`),taskPage:async e=>{let t=await Bp(`/api/tasks`+Pp(e),{headers:{Accept:`application/json`},signal:AbortSignal.timeout(Np)});return{tasks:await t.json(),next:t.headers.get(`X-Next-Cursor`)}},taskMeta:()=>Vp(`/api/task-meta`),task:e=>Vp(`/api/tasks/${encodeURIComponent(e)}`),taskAttempts:e=>Vp(`/api/tasks/${encodeURIComponent(e)}/attempts`),taskChanges:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/changes`+Pp(t)),taskDebug:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/debug`+Pp(t)),taskAction:(e,t,n)=>Vp(`/api/tasks/${encodeURIComponent(e)}/action`,{method:`POST`,body:{action:t,...n}}),setup:()=>Vp(`/api/setup`),capabilities:()=>Vp(`/api/capabilities`),workflows:()=>Vp(`/api/workflows`),workflowEnabled:(e,t)=>Vp(`/api/workflows/${encodeURIComponent(e)}/enabled`,{method:`PUT`,body:{enabled:t},parse:!1}),workRequest:e=>Vp(`/api/work-requests`,{method:`POST`,body:e}),skills:()=>Vp(`/api/skills`),channels:()=>Vp(`/api/channels`),curators:()=>Vp(`/api/curators`),channelReload:e=>Vp(`/api/channels/${encodeURIComponent(e)}/reload`,{method:`POST`,body:{}}),config:()=>Vp(`/api/config`),logs:e=>Vp(`/api/logs`+Pp(e)),taskLogs:(e,t)=>Vp(`/api/tasks/${encodeURIComponent(e)}/logs`+Pp(t)),taskLogDownloadURL:(e,t)=>`/api/tasks/${encodeURIComponent(e)}/logs/download`+(t==null?``:`?attempt=${t}`),version:()=>Vp(`/api/version`),updateSnapshot:()=>Vp(`/api/chat/update`),updateInstall:e=>Vp(`/api/chat/update/install`,{method:`POST`,body:{snapshot:e},timeoutMs:9e5}),captures:e=>Vp(`/api/captures`+Pp({limit:e})),eventTypes:()=>Vp(`/api/event-types`),eventTypeCreate:e=>Vp(`/api/event-types`,{method:`POST`,body:e}),eventTypeUpdate:(e,t)=>Vp(`/api/event-types/${encodeURIComponent(e)}`,{method:`PUT`,body:t}),eventTypeDelete:e=>Vp(`/api/event-types/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappings:()=>Vp(`/api/mappings`),mappingCreate:e=>Vp(`/api/mappings`,{method:`POST`,body:e}),mappingUpdate:(e,t)=>Vp(`/api/mappings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),mappingDelete:e=>Vp(`/api/mappings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),mappingPreview:(e,t)=>Vp(`/api/mappings/preview`,{method:`POST`,body:{capture_id:e,fields:t}}),bindings:()=>Vp(`/api/bindings`),dispatches:(e,t)=>Vp(`/api/${e}/${encodeURIComponent(t)}/dispatches`),bindingCreate:e=>Vp(`/api/bindings`,{method:`POST`,body:e}),bindingUpdate:(e,t)=>Vp(`/api/bindings/${encodeURIComponent(e)}`,{method:`PATCH`,body:t}),bindingDelete:e=>Vp(`/api/bindings/${encodeURIComponent(e)}`,{method:`DELETE`,parse:!1}),bindingApprove:e=>Vp(`/api/bindings/${encodeURIComponent(e)}/approve`,{method:`POST`}),bindingPause:e=>Vp(`/api/bindings/${encodeURIComponent(e)}/pause`,{method:`POST`}),bindingResume:e=>Vp(`/api/bindings/${encodeURIComponent(e)}/resume`,{method:`POST`}),harnessBindings:()=>Vp(`/api/harness/bindings`),sources:()=>Vp(`/api/sources`),sourceCreate:e=>Vp(`/api/sources`,{method:`POST`,body:{path:e}}),sourceSigning:(e,t)=>Vp(`/api/sources/${encodeURIComponent(e)}/signing`,{method:`POST`,body:{signed:t}}),sourceApproveUnsigned:e=>Vp(`/api/sources/${encodeURIComponent(e)}/approve-unsigned`,{method:`POST`}),sourceSecret:e=>Vp
Line truncated
|
||||
|
||||
`);u=r.pop()||``;for(let e of r){let t=e.split(`
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(im.value=n.session_id),n.type===`delta`&&(o+=n.text,lm.value=lm.value?{...lm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],lm.value=lm.value?{...lm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);am.value=[...am.value,{from:`assistant`,text:o,tool_calls:a}],lm.value=null,sm.value=`Ready`,await wm()}catch(e){let t=e;t.name===`AbortError`&&!c?(lm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},sm.value=`Stopped`):(lm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?$p(r):void 0,isRetry:i},sm.value=`Error — retry available`)}finally{clearTimeout(l),Sm=null,cm.value=!1}}function Cee(){sm.value=`Stopping…`,im.value&&Z.chatCancel(im.value).catch(()=>{}),Cm()}function wee(){Hi(()=>{wm().catch(e=>{sm.value=e.message||`Chat unavailable`})}),Ki(()=>{Cm()})}var Tee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Eee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(tm),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(Sd),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(Qd),{size:22})],2)],8,Tee))}});function Nm(e){return typeof e==`string`?`'${e}'`:new Oee().serialize(e)}var Dee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Pm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Dee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Fm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Pm[n]?Pm[n]:n+128,s=a<128&&Pm[a]?Pm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var Oee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Fm(e,t):n===`number`&&r===`number`?e-t:Fm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Fm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`FloatLine truncated
|
||||
`).find(e=>e.startsWith(`data: `));if(!t)continue;let n=JSON.parse(t.slice(6));if(n.session_id&&(rm.value=n.session_id),n.type===`delta`&&(o+=n.text,cm.value=cm.value?{...cm.value,text:o}:null),(n.type===`tool`||n.type===`navigate`)&&(a=[...a,n],cm.value=cm.value?{...cm.value,tools:a}:null),n.type===`done`&&(s=!0,o||=n.text||``),n.type===`error`)throw Error(n.text)}if(t)break}if(!s)throw Error(`chat stream ended before completion`);im.value=[...im.value,{from:`assistant`,text:o,tool_calls:a}],cm.value=null,om.value=`Ready`,await Cm()}catch(e){let t=e;t.name===`AbortError`&&!c?(cm.value={text:`Turn stopped.`,tools:a,isError:!1,turn:r,isRetry:i},om.value=`Stopped`):(cm.value={text:`Unable to complete that turn: ${t.message||t}`,tools:a,isError:!0,turn:r?Qp(r):void 0,isRetry:i},om.value=`Error — retry available`)}finally{clearTimeout(l),xm=null,sm.value=!1}}function wee(){om.value=`Stopping…`,rm.value&&Z.chatCancel(rm.value).catch(()=>{}),Sm()}function Tee(){Vi(()=>{Cm().catch(e=>{om.value=e.message||`Chat unavailable`})}),Gi(()=>{Sm()})}var Eee=[`aria-label`,`title`,`aria-expanded`,`aria-controls`],Dee=L({__name:`ChatFab`,props:{open:{type:Boolean}},emits:[`toggle`],setup(e,{emit:t}){let n=t;function r(e){return X(`col-start-1 row-start-1 grid place-items-center transition-[opacity,transform] duration-[140ms]`,e?`opacity-100`:`-rotate-45 scale-[0.7] opacity-0`)}return(t,i)=>(V(),H(`button`,{type:`button`,class:`relative z-10 grid size-14 cursor-pointer place-items-center rounded-full border border-border-strong bg-secondary text-primary shadow-[var(--shadow-md)] transition-transform duration-[140ms] hover:-translate-y-px focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary active:translate-y-0`,"aria-label":e.open?`Close chat`:`Chat with Archie`,title:e.open?`Close chat`:`Chat with Archie`,"aria-expanded":e.open,"aria-controls":P(em),onClick:i[0]||=e=>n(`toggle`)},[W(`span`,{"aria-hidden":`true`,class:j(r(!e.open))},[G(P(xd),{size:22})],2),W(`span`,{"aria-hidden":`true`,class:j(r(e.open))},[G(P(Zd),{size:22})],2)],8,Eee))}});function Mm(e){return typeof e==`string`?`'${e}'`:new kee().serialize(e)}var Oee=` _-,;:!?.'"()[]{}@*/\\&#%\`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz`,Nm=(function(){let e=new Uint8Array(128);for(let t=0;t<69;t++)e[Oee.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function Pm(e,t){if(e===t)return 0;let n=Math.min(e.length,t.length),r=0;for(let i=0;i<n;i++){let n=e.charCodeAt(i),a=t.charCodeAt(i);if(n===a)continue;let o=n<128&&Nm[n]?Nm[n]:n+128,s=a<128&&Nm[a]?Nm[a]:a+128;if(o!==s)return o<s?-1:1;r===0&&(r=n>a?-1:1)}return e.length===t.length?r:e.length<t.length?-1:1}var kee=(function(){class e{#e=new Map;compare(e,t){let n=typeof e,r=typeof t;return n===`string`&&r===`string`?Pm(e,t):n===`number`&&r===`number`?e-t:Pm(this.serialize(e,!0),this.serialize(t,!0))}serialize(e,t){if(e===null)return`null`;switch(typeof e){case`string`:return t?e:`'${e}'`;case`bigint`:return`${e}n`;case`object`:return this.$object(e);case`function`:return this.$function(e)}return String(e)}serializeObject(e){let t=Object.prototype.toString.call(e);if(t!==`[object Object]`)return this.serializeBuiltInType(t.length<10?`unknown:${t}`:t.slice(8,-1),e);let n=e.constructor,r=n===Object||n===void 0?``:n.name;if(r!==``&&globalThis[r]===n)return this.serializeBuiltInType(r,e);if(`toJSON`in e&&typeof e.toJSON==`function`){let t=e.toJSON();return r+(typeof t==`object`&&t?this.$object(t):`(${this.serialize(t)})`)}let i=Object.keys(e).sort(Pm),a=`${r}{`;for(let t=0;t<i.length;t++){let n=i[t];a+=`${n}:${this.serialize(e[n])}`,t<i.length-1&&(a+=`,`)}return a+`}`}serializeBuiltInType(e,t){let n=this[`$`+e];if(n)return n.call(this,t);if(typeof t.entries==`function`)return this.serializeObjectEntries(e,t.entries());throw Error(`Cannot serialize ${e}`)}serializeObjectEntries(e,t){let n=Array.from(t).sort((e,t)=>this.compare(e[0],t[0])),r=`${e}{`;for(let e=0;e<n.length;e++){let[t,i]=n[e];r+=`${this.serialize(t,!0)}:${this.serialize(i)}`,e<n.length-1&&(r+=`,`)}return r+`}`}$object(e){let t=this.#e.get(e);return t===void 0&&(this.#e.set(e,`#${this.#e.size}`),t=this.serializeObject(e),this.#e.set(e,t)),t}$function(e){let t=Function.prototype.toString.call(e);return t.slice(-15)===`[native code] }`?`${e.name||``}()[native]`:`${e.name}(${e.length})${t.replace(/\s*\n\s*/g,``)}`}$Array(e){let t=`[`;for(let n=0;n<e.length;n++)t+=this.serialize(e[n]),n<e.length-1&&(t+=`,`);return t+`]`}$Date(e){try{return`Date(${e.toISOString()})`}catch{return`Date(null)`}}$ArrayBuffer(e){return`ArrayBuffer[${new Uint8Array(e).join(`,`)}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((e,t)=>this.compare(e,t)))}`}$Map(e){return this.serializeObjectEntries(`Map`,e.entries())}}for(let t of[`Error`,`RegExp`,`URL`])e.prototype[`$`+t]=function(e){return`${t}(${e})`};for(let t of[`Int8Array`,`Uint8Array`,`Uint8ClampedArray`,`Int16Array`,`Uint16Array`,`Int32Array`,`Uint32Array`,`Float32Array`,`FloatLine truncated
|
||||
`)].join(`
|
||||
`))}return()=>i.value||r.value||o.value?Bs(t.default({present:o.value})[0],{ref:e=>{let t=ch(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Eg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=wh(n.default()),r=e.findIndex(e=>e.type!==Yo);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=us({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Dg=[`area`,`img`,`input`],Og=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Dg.includes(r)?()=>Bs(r,t):r===`template`?()=>Bs(Eg,t,{default:n.default}):()=>Bs(e.as,t,{default:n.default})}});function kg(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:ch(e))}}var[Ag,jg]=Bm(`CollapsibleRoot`),Mg=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=Ch(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=vn(r);return jg({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Q(),(e,t)=>(V(),U(P(Og),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Ng=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=Ag();i.contentId||=hg(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Q(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await qn();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Hi(()=>{requestAnimationFrame(()=>{d.value=!1})}),lh(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(Tg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(Og),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Pg=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Q();let n=Ag();return(e,r)=>(V(),U(P(Og),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Fg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Ig({type:e,defaultValue:t,modelValue:n}){return e||Fg({type:e,defaultValue:t,modelValue:n})}function Lg({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Rg(e,t){let n=Y(()=>Ig(e)),r=Ch(e,`modelValue`,t,{defaultValue:Lg(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Im(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Wm(t,e)){let n=t.findIndex(t=>Im(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[zg,Bg]=Bm(`AccordionRoot`),Vg=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!
Line truncated
|
||||
`))}return()=>i.value||r.value||o.value?zs(t.default({present:o.value})[0],{ref:e=>{let t=sh(e);return t?.hasAttribute===void 0||(t?.hasAttribute(`data-reka-popper-content-wrapper`)?a.value=t.firstElementChild:a.value=t),t}}):null}}),Tg=L({name:`PrimitiveSlot`,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){return()=>{if(!n.default)return null;let e=Ch(n.default()),r=e.findIndex(e=>e.type!==Jo);if(r===-1)return e;let i=e[r];delete i.props?.ref;let a=i.props?J(t,i.props):t,o=ls({...i,props:{}},a);return e.length===1?o:(e[r]=o,e)}}}),Eg=[`area`,`img`,`input`],Dg=L({name:`Primitive`,inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:`div`}},setup(e,{attrs:t,slots:n}){let r=e.asChild?`template`:e.as;return typeof r==`string`&&Eg.includes(r)?()=>zs(r,t):r===`template`?()=>zs(Tg,t,{default:n.default}):()=>zs(e.as,t,{default:n.default})}});function Og(){let e=N();return{primitiveElement:e,currentElement:Y(()=>[`#text`,`#comment`].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:sh(e))}}var[kg,Ag]=zm(`CollapsibleRoot`),jg=L({__name:`CollapsibleRoot`,props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:open`],setup(e,{expose:t,emit:n}){let r=e,i=Sh(r,`open`,n,{defaultValue:r.defaultOpen,passive:r.open===void 0}),{disabled:a,unmountOnHide:o}=vn(r);return Ag({contentId:``,disabled:a,open:i,unmountOnHide:o,onOpenToggle:()=>{a.value||(i.value=!i.value)}}),t({open:i}),Q(),(e,t)=>(V(),U(P(Dg),{as:e.as,"as-child":r.asChild,"data-state":P(i)?`open`:`closed`,"data-disabled":P(a)?``:void 0},{default:F(()=>[z(e.$slots,`default`,{open:P(i)})]),_:3},8,[`as`,`as-child`,`data-state`,`data-disabled`]))}}),Mg=L({inheritAttrs:!1,__name:`CollapsibleContent`,props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`contentFound`],setup(e,{emit:t}){let n=e,r=t,i=kg();i.contentId||=mg(void 0,`reka-collapsible-content`);let a=N(),{forwardRef:o,currentElement:s}=Q(),c=N(0),l=N(0),u=Y(()=>i.open.value),d=N(u.value),f=N();I(()=>[u.value,a.value?.present],async()=>{await qn();let e=s.value;if(!e)return;f.value=f.value||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();l.value=t.height,c.value=t.width,d.value||(e.style.transitionDuration=f.value.transitionDuration,e.style.animationName=f.value.animationName)},{immediate:!0});let p=Y(()=>d.value&&i.open.value);return Vi(()=>{requestAnimationFrame(()=>{d.value=!1})}),ch(s,`beforematch`,e=>{requestAnimationFrame(()=>{i.onOpenToggle(),r(`contentFound`)})}),(e,t)=>(V(),U(P(wg),{ref_key:`presentRef`,ref:a,present:e.forceMount||P(i).open.value,"force-mount":!0},{default:F(({present:t})=>[G(P(Dg),J(e.$attrs,{id:P(i).contentId,ref:P(o),"as-child":n.asChild,as:e.as,hidden:t?void 0:P(i).unmountOnHide.value?``:`until-found`,"data-state":p.value?void 0:P(i).open.value?`open`:`closed`,"data-disabled":P(i).disabled?.value?``:void 0,style:{"--reka-collapsible-content-height":`${l.value}px`,"--reka-collapsible-content-width":`${c.value}px`}}),{default:F(()=>[!P(i).unmountOnHide.value||t?z(e.$slots,`default`,{key:0}):q(`v-if`,!0)]),_:2},1040,[`id`,`as-child`,`as`,`hidden`,`data-state`,`data-disabled`,`style`])]),_:3},8,[`present`]))}}),Ng=L({__name:`CollapsibleTrigger`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`}},setup(e){let t=e;Q();let n=kg();return(e,r)=>(V(),U(P(Dg),{type:e.as===`button`?`button`:void 0,as:e.as,"as-child":t.asChild,"aria-controls":P(n).contentId,"aria-expanded":P(n).open.value,"data-state":P(n).open.value?`open`:`closed`,"data-disabled":P(n).disabled?.value?``:void 0,disabled:P(n).disabled?.value,onClick:P(n).onOpenToggle},{default:F(()=>[z(e.$slots,`default`)]),_:3},8,[`type`,`as`,`as-child`,`aria-controls`,`aria-expanded`,`data-state`,`data-disabled`,`disabled`,`onClick`]))}});function Pg({type:e,defaultValue:t,modelValue:n}){let r=n||t;return n!==void 0||t!==void 0?Array.isArray(r)?`multiple`:`single`:e??`single`}function Fg({type:e,defaultValue:t,modelValue:n}){return e||Pg({type:e,defaultValue:t,modelValue:n})}function Ig({type:e,defaultValue:t}){return t===void 0?e===`single`?void 0:[]:t}function Lg(e,t){let n=Y(()=>Fg(e)),r=Sh(e,`modelValue`,t,{defaultValue:Ig(e),passive:e.modelValue===void 0,deep:!0});function i(e){if(n.value===`single`)r.value=Fm(e,r.value)?void 0:e;else{let t=Array.isArray(r.value)?[...r.value||[]]:[r.value].filter(Boolean);if(Um(t,e)){let n=t.findIndex(t=>Fm(t,e));t.splice(n,1)}else t.push(e);r.value=t}}return{modelValue:r,changeModelValue:i,isSingle:Y(()=>n.value===`single`)}}var[Rg,zg]=zm(`AccordionRoot`),Bg=L({__name:`AccordionRoot`,props:{collapsible:{type:Boolean,required:!
Line truncated
|
||||
- a positive number
|
||||
- less than the value passed to \`max\` (or ${yS} if no \`max\` prop is set)
|
||||
- less than the value passed to \`max\` (or ${vS} if no \`max\` prop is set)
|
||||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||||
|
||||
Defaulting to \`null\`.`),null)}function wS(e){return SS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${yS}\`.`),yS)}var TS=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:yS},getValueLabel:{type:Function,required:!1,default:(e,t)=>SS(e)?`${Math.round(e/t*yS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Q();let i=Ch(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Ch(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=CS(e,n.max);t!==e&&(await qn(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=wS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Um(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return xS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(Og),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":SS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),ES=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=bS();return Q(),(e,r)=>(V(),U(P(Og),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),DS=`radio.select`;function OS(e,t,n){Hm(DS,n,{originalEvent:e,value:t})}var kS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=Ch(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=vn(n),{forwardRef:o,currentElement:s}=Q(),c=qh(s),l=Xh(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||OS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(Og),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:Vl(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(rv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[AS,jS]=Bm(`RadioGroupRoot`),MS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Q(),o=Ch(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=vn(n),p=Hh(f),m=qh(a);return jS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(zb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(Og),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(rv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Lee,NS]=Bm(`RadioGroupItem`),PS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:OE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>OE(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
|
||||
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=AE(c),u=e+1<n.length?AE(n[e+1]):null;if(l&&u&&jE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=AE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>OE(e)),rows:r.map(e=>e.map(e=>OE(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:OE(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:OE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function AE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function jE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var ME={class:`[overflow-wrap:anywhere]`},NE={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},PE={class:`font-mono text-[0.85em]`},FE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},IE={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},zee={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Bee={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Vee={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Hee={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Uee={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Wee={key:8,class:`mb-2.5 last:mb-0`},Gee=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>kE(t.text));return(e,t)=>(V(),H(`div`,ME,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,NE,[W(`code`,PE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,FE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(EE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(EE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,IE,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,zee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,Bee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,Vee,[G(EE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,Hee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,Uee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(EE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,Wee,[G(EE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Kee={class:`truncate`},qee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=$i(`RouterLink`);return V(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:F(()=>[G(P(Xu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Kee,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Jee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Yee={class:`font-semibold text-foreground`},Xee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},Zee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(V(),U(qee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Jee,[G(P(Zd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Yee,M(n.value),1),r.value?(V(),H(`code`,Xee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),Qee={key:0,class:`mb-2 grid gap-0.5 text-xs`},$ee={key:1,class:`mb-2 flex flex-wrap gap-1.5`},ete={key:3,class:`whitespace-pre-wrap`},LE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(V(),H(`div`,Qee,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U(Zee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,$ee,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(yE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(Gee,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,ete,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),tte={class:`w-full self-center justify-self-center py-6 text-center`},nte={class:`grid gap-2`},rte=[`onClick`],ite=L(
Line truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Mj?`${n.slice(0,Mj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Pj=[`title`],Fj=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>ij(n.event)),a=Y(()=>Nj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?fA(n.event.at):`—`);return(e,t)=>(V(),U(P(kj),{class:j(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Hl(Vl(o,[`prevent`]),[`enter`]),Hl(Vl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(Oj),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(Oj),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(Oj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Pj)]),_:1}),G(P(Oj),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Ij=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Lj(e){return(Number(e?.task_id)||0)>0}function Rj(e,t){return t===`tasks`?Lj(e):t!==`system`||!Lj(e)}function zj(e,t){return e.filter(e=>Rj(e,t))}function Bj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function Vj(e,t){return`${e}:${t??0}`}function Hj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=Vj(Nj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Uj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Wj={class:`max-h-[28rem] overflow-y-auto`},Gj=[`aria-expanded`,`aria-label`,`onClick`],Kj=[`title`],qj=L({__name:`LiveActivityCard`,setup(e){let t=QE(),{activity:n,streamKind:r,streamState:i}=Fu(mk()),a=N(`all`),o=Y(()=>zj(n.value,a.value)),s=Y(()=>Bj(o.value.length,a.value)),c=Jt(new Set),l=Y(()=>Hj(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return Nj(e.representative)}function p(e){return e.representative.at?fA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(aA),null,{default:F(()=>[G(P(uA),null,{default:F(()=>[G(P(dA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(oA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(wj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Ij)},null,8,[`modelValue`,`options`]),G(P(nA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(sA),null,{default:F(()=>[W(`div`,Uj,[W(`div`,Wj,[G(P(Ej),null,{default:F(()=>[G(P(jj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(kj),null,{default:F(()=>[G(P(Aj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(Aj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Dj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(kj),{key:0},{default:F(()=>[G(P(Oj),{colspan:`4`},{default:F(()=>[G(P(Jk),null,{default:F(()=>[G(P(Zk),null,{default:F(()=>[G(P(eA),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Fj,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(kj),{class:j(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Hl(Vl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Hl(Vl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(Oj),{class:`font-medium`},{default:F(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Vl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(rd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(id),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(nA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,Gj)]),_:2},1024),G(P(Oj),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(Oj),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,Kj)]),_:2},1024),G(P(Oj),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Fj,{key:`${e.key}:${n}`,ev
Line truncated
|
||||
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function mN(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function hN(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function gN(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function _N(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var vN=N([]),yN=N([]),bN=N(!0),xN=N(null),SN=N(null),CN=N(!1),wN=N(null);async function TN(){try{let e=await Z.eventTypes();bN.value=e.enabled!==!1,vN.value=e.event_types||[],yN.value=e.proposals||[],xN.value=null}catch(e){xN.value=e.message||String(e)}}function EN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function DN(e){wN.value=null,SN.value=e}function ON(e){let t=IN.value.find(t=>String(t.id)===e.sample_id);DN({mode:`proposal`,id:null,source:e.source,name:``,rule:EN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function kN(e=``){DN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function AN(e){DN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:EN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function jN(){SN.value=null}async function MN(){let e=SN.value;if(e){CN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:_N(e.rule)});else{let t=e.mode===`paste`?pN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:_N(e.rule),example:{headers:t,body:e.body}})}SN.value=null,await TN()}catch(e){wN.value=e.message||String(e)}finally{CN.value=!1}}}var NN=N(null);async function PN(){let e=NN.value;if(NN.value=null,e)try{await Z.eventTypeDelete(e.id),await TN()}catch(e){xN.value=e.message||String(e)}}var FN=100,IN=N([]),LN=N(!0),RN=N(null),zN=N(!0),BN=N(null);async function VN(){try{let e=await Z.captures(FN);LN.value=e.enabled!==!1,IN.value=e.captures||[],RN.value=null}catch(e){RN.value=e.message||String(e)}finally{zN.value=!1}}function HN(e){let t=IN.value.find(t=>t.id===e);return t&&(BN.value=t),!!t}function UN(){IN.value.length&&(BN.value=IN.value[0])}function WN(){hk(`captures`,()=>{VN(),TN()})}var GN=`archie.theme`,KN=`archie.density`,qN=`archie.motion`,JN=`archie.tooltips`;function YN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function XN(e,t){try{localStorage.setItem(e,t)}catch{}}function ZN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var QN=Pu(`appearance`,()=>{let e=N(YN(GN,[`system`,`dark`,`light`],`dark`)),t=N(YN(KN,[`comfortable`,`compact`],`comfortable`)),n=N(YN(qN,[`system`,`reduced`],`system`)),r=N(YN(JN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=ZN(e.value)}function o(t){e.value=t,a(),XN(GN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,XN(KN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,XN(qN,e)}function l(e){r.value=e,XN(JN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),$N=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Yh(n,t),{tooltipsEnabled:i}=Fu(QN());return(e,t)=>(V(),U(P(XC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(ls(t)))]),_:3},16,[`disabled`]))}}),eP=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Yh(gw(n,`class`),r);return(e,t)=>(V(),U(P(ew),null,{default:F(
Line truncated
|
||||
`)}};lJ.defaultYaml={explicit:!1,version:`1.2`},lJ.defaultTags={"!!":`tag:yaml.org,2002:`};function uJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function dJ(e){let t=new Set;return nJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function fJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function pJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=dJ(e);let a=fJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(Jq(t.node)||Xq(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function mJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=mJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=mJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=mJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=mJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function hJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>hJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Qq(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var gJ=class{constructor(e){Object.defineProperty(this,Uq,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Gq(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=hJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?mJ(i,{"":o},``,o):o}},_J=class extends gJ{constructor(e){super(Lq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],nJ(e,{Node:(e,t)=>{(Wq(t)||Qq(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(hJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=vJ(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(uJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function vJ(e,t,n){if(Wq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Xq(t)){let r=0;for(let i of t.items){let t=vJ(e,i,n);t>r&&(r=t)}return r}if(qq(t)){let r=vJ(e,t.key,n),i=vJ(e,t.value,n);return Math.max(r,i)}return 1}var yJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,bJ=class extends gJ{constructor(e){super(Vq),this.value=e}toJSON(e,t){return t?.keep?this.value:hJ(this.value,e,t)}toString(){return String(this.value)}};bJ.BLOCK_FOLDED=`BLOCK_FOLDED`,bJ.BLOCK_LITERAL=`BLOCK_LITERAL`,bJ.PLAIN=`PLAIN`,bJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,bJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var xJ=`tag:yaml.org,2002:`;function SJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function CJ(e,t,n){if(Gq(e)&&(e=e.contents),Zq(e))return e;if(qq(e)){let t=n.schema[zq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new _J(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=xJ+t.slice(2));let l=SJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new bJ(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?OJ(n,t):n.includes(`
|
||||
Defaulting to \`null\`.`),null)}function CS(e){return xS(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vS}\`.`),vS)}var wS=L({__name:`ProgressRoot`,props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:vS},getValueLabel:{type:Function,required:!1,default:(e,t)=>xS(e)?`${Math.round(e/t*vS)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:[`update:modelValue`,`update:max`],setup(e,{emit:t}){let n=e,r=t;Q();let i=Sh(n,`modelValue`,r,{passive:n.modelValue===void 0}),a=Sh(n,`max`,r,{passive:n.max===void 0});I(()=>i.value,async e=>{let t=SS(e,n.max);t!==e&&(await qn(),i.value=t)},{immediate:!0}),I(()=>n.max,e=>{let t=CS(n.max);t!==e&&(a.value=t)},{immediate:!0});let o=Y(()=>Hm(i.value)?`indeterminate`:i.value===a.value?`complete`:`loading`);return bS({modelValue:i,max:a,progressState:o}),(e,t)=>(V(),U(P(Dg),{"as-child":e.asChild,as:e.as,"aria-valuemax":P(a),"aria-valuemin":0,"aria-valuenow":xS(P(i))?P(i):void 0,"aria-valuetext":e.getValueText?.(P(i),P(a)),"aria-label":e.getValueLabel(P(i),P(a)),role:`progressbar`,"data-state":o.value,"data-value":P(i)??void 0,"data-max":P(a)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(i)})]),_:3},8,[`as-child`,`as`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`,`aria-label`,`data-state`,`data-value`,`data-max`]))}}),TS=L({__name:`ProgressIndicator`,props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){let t=e,n=yS();return Q(),(e,r)=>(V(),U(P(Dg),J(t,{"data-state":P(n).progressState.value,"data-value":P(n).modelValue?.value??void 0,"data-max":P(n).max.value}),{default:F(()=>[z(e.$slots,`default`)]),_:3},16,[`data-state`,`data-value`,`data-max`]))}}),ES=`radio.select`;function DS(e,t,n){Vm(ES,n,{originalEvent:e,value:t})}var OS=L({inheritAttrs:!1,__name:`Radio`,props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:`button`},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:[`update:checked`,`select`],setup(e,{emit:t}){let n=e,r=t,i=Sh(n,`checked`,r,{passive:n.checked===void 0}),{value:a}=vn(n),{forwardRef:o,currentElement:s}=Q(),c=Kh(s),l=Yh(),u=Y(()=>n.id&&s.value?document.querySelector(`[for="${n.id}"]`)?.innerText:void 0);function d(e){n.disabled||DS(e,n.value,e=>{r(`select`,e),!e?.defaultPrevented&&(i.value=!0,c.value&&e.stopPropagation())})}return(e,t)=>(V(),H(B,null,[G(P(Dg),J({id:e.id,ref:P(o),role:`radio`,type:e.as===`button`?`button`:void 0,as:e.as,"aria-checked":P(i)??!1,"aria-label":u.value,"as-child":e.asChild,disabled:e.disabled?``:void 0,"data-state":P(i)?`checked`:`unchecked`,"data-disabled":e.disabled?``:void 0,value:P(a),required:e.required,name:e.name},{...P(l),...e.$attrs},{onClick:Bl(d,[`stop`])}),{default:F(()=>[z(e.$slots,`default`,{checked:P(i)})]),_:3},16,[`id`,`type`,`as`,`aria-checked`,`aria-label`,`as-child`,`disabled`,`data-state`,`data-disabled`,`value`,`required`,`name`]),P(c)&&e.name?(V(),U(P(nv),J({key:0,type:`radio`,tabindex:`-1`,value:P(a),checked:!!P(i),name:e.name,disabled:e.disabled,required:e.required},P(l)),null,16,[`value`,`checked`,`name`,`disabled`,`required`])):q(`v-if`,!0)],64))}}),[kS,AS]=zm(`RadioGroupRoot`),jS=L({__name:`RadioGroupRoot`,props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=e,r=t,{forwardRef:i,currentElement:a}=Q(),o=Sh(n,`modelValue`,r,{defaultValue:n.defaultValue,passive:n.modelValue===void 0}),{disabled:s,loop:c,orientation:l,name:u,required:d,dir:f}=vn(n),p=Vh(f),m=Kh(a);return AS({modelValue:o,changeModelValue:e=>{o.value=e},disabled:s,loop:c,orientation:l,name:u?.value,required:d}),(e,t)=>(V(),U(P(Rb),{"as-child":``,orientation:P(l),dir:P(p),loop:P(c)},{default:F(()=>[G(P(Dg),{ref:P(i),role:`radiogroup`,"data-disabled":P(s)?``:void 0,"as-child":e.asChild,as:e.as,"aria-orientation":P(l),"aria-required":P(d),dir:P(p)},{default:F(()=>[z(e.$slots,`default`,{modelValue:P(o)}),P(m)&&P(u)?(V(),U(P(nv),{key:0,required:P(d),disabled:P(s),value:P(o),name:P(u)},null,8,[`required`,`disabled`,`value`,`name`])):q(`v-if`,!0)]),_:3},8,[`data-disabled`,`as-child`,`as`,`aria-orientation`,`aria-required`,`dir`])]),_:3},8,[`orientation`,`dir`,`loop`]))}}),[Ree,MS]=zm(`RadioGroupItem`),NS=L({inheritAttrs:!1,__name:`RadioGroupItem`,props:{id:{type:String,required:!1},value:{type:nuLine truncated
|
||||
`),r=[],i=null,a=null,o=()=>{r.length&&(t.push({kind:`p`,inline:DE(r.join(` `))}),r=[])},s=()=>{i&&=(t.push({kind:i.tag,items:i.items.map(e=>DE(e))}),null)};for(let e=0;e<n.length;e++){let c=n[e];if(c.startsWith("```")){o(),s(),a?(t.push({kind:`pre`,code:a.join(`
|
||||
`)}),a=null):a=[];continue}if(a){a.push(c);continue}let l=kE(c),u=e+1<n.length?kE(n[e+1]):null;if(l&&u&&AE(u)&&l.length===u.length){o(),s();let r=[];for(e+=2;e<n.length;e++){let t=kE(n[e]);if(!t||t.length!==l.length){e--;break}r.push(t)}t.push({kind:`table`,head:l.map(e=>DE(e)),rows:r.map(e=>e.map(e=>DE(e)))});continue}if(!c.trim()){o(),s();continue}let d=c.match(/^(#{1,3})\s+(.+)$/);if(d){o(),s(),t.push({kind:`h${d[1].length}`,inline:DE(d[2])});continue}let f=c.match(/^\s*[-*]\s+(.+)$/),p=c.match(/^\s*\d+[.)]\s+(.+)$/);if(f||p){o();let e=p?`ol`:`ul`;(!i||i.tag!==e)&&(s(),i={tag:e,items:[]}),i.items.push((f||p)[1]);continue}if(c.startsWith(`>`)){o(),s(),t.push({kind:`blockquote`,inline:DE(c.replace(/^>\s?/,``))});continue}r.push(c)}return o(),s(),a&&t.push({kind:`pre`,code:a.join(`
|
||||
`)}),t}function kE(e){let t=String(e||``).trim();if(!t.includes(`|`))return null;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`).map(e=>e.trim());return n.length>1&&n.every(e=>e!==``)?n:null}function AE(e){return e.every(e=>/^:?-{3,}:?$/.test(e))}var jE={class:`[overflow-wrap:anywhere]`},ME={key:0,class:`my-2 overflow-auto rounded-md border border-border bg-background/60 p-3`},NE={class:`font-mono text-[0.85em]`},PE={key:1,class:`my-3 w-full border-collapse text-[0.92em]`},Bee={key:2,class:`my-2 border-l-[3px] border-primary pl-3 text-fg-muted`},Vee={key:3,class:`mt-1 mb-2 text-xl leading-tight font-semibold tracking-[-0.02em]`},Hee={key:4,class:`mt-1 mb-2 text-lg leading-tight font-semibold tracking-[-0.02em]`},Uee={key:5,class:`mt-1 mb-2 text-base leading-tight font-semibold tracking-[-0.02em]`},Wee={key:6,class:`my-2.5 flex list-disc flex-col gap-1 pl-5`},Gee={key:7,class:`my-2.5 flex list-decimal flex-col gap-1 pl-5`},Kee={key:8,class:`mb-2.5 last:mb-0`},qee=L({__name:`ChatMarkdown`,props:{text:{}},setup(e){let t=e,n=Y(()=>OE(t.text));return(e,t)=>(V(),H(`div`,jE,[(V(!0),H(B,null,R(n.value,(e,t)=>(V(),H(B,{key:t},[e.kind===`pre`?(V(),H(`pre`,ME,[W(`code`,NE,M(e.code),1)])):e.kind===`table`?(V(),H(`table`,PE,[W(`thead`,null,[W(`tr`,null,[(V(!0),H(B,null,R(e.head,(e,t)=>(V(),H(`th`,{key:t,class:`border border-border bg-muted px-2 py-1.5 text-left font-semibold`},[G(TE,{inline:e},null,8,[`inline`])]))),128))])]),W(`tbody`,null,[(V(!0),H(B,null,R(e.rows,(e,t)=>(V(),H(`tr`,{key:t},[(V(!0),H(B,null,R(e,(e,t)=>(V(),H(`td`,{key:t,class:`border border-border px-2 py-1.5 text-left`},[G(TE,{inline:e},null,8,[`inline`])]))),128))]))),128))])])):e.kind===`blockquote`?(V(),H(`blockquote`,Bee,[G(TE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h1`?(V(),H(`h1`,Vee,[G(TE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h2`?(V(),H(`h2`,Hee,[G(TE,{inline:e.inline},null,8,[`inline`])])):e.kind===`h3`?(V(),H(`h3`,Uee,[G(TE,{inline:e.inline},null,8,[`inline`])])):e.kind===`ul`?(V(),H(`ul`,Wee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(TE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`ol`?(V(),H(`ol`,Gee,[(V(!0),H(B,null,R(e.items,(e,t)=>(V(),H(`li`,{key:t},[G(TE,{inline:e},null,8,[`inline`])]))),128))])):e.kind===`p`?(V(),H(`p`,Kee,[G(TE,{inline:e.inline},null,8,[`inline`])])):q(``,!0)],64))),128))]))}}),Jee={class:`truncate`},Yee=L({__name:`ChatNavChip`,props:{path:{},label:{}},setup(e){return(t,n)=>{let r=Qi(`RouterLink`);return V(),U(r,{to:e.path,title:`Go to ${e.label||e.path}`,class:`inline-flex max-w-full items-center gap-1.5 rounded-full border border-primary/45 bg-primary-soft px-2.5 py-1 text-xs font-semibold text-link transition-colors hover:border-primary hover:bg-primary/15 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary`},{default:F(()=>[G(P(Yu),{"aria-hidden":`true`,class:`size-3.5 shrink-0`}),W(`span`,Jee,M(e.label||e.path),1)]),_:1},8,[`to`,`title`])}}}),Xee={key:1,class:`flex items-baseline gap-1.5 [overflow-wrap:anywhere]`},Zee={class:`font-semibold text-foreground`},Qee={key:0,class:`font-mono text-[0.95em] text-fg-subtle`},$ee=L({__name:`ChatToolCall`,props:{tool:{},streaming:{type:Boolean}},setup(e){let t=e,n=Y(()=>t.tool.name||t.tool.Name||t.tool.tool||`tool`),r=Y(()=>t.tool.parameters||t.tool.Parameters||``),i=Y(()=>!!(t.tool.err||t.tool.Err||t.tool.failed)),a=Y(()=>t.tool.summary||t.tool.Summary||t.tool.text||t.tool.err||t.tool.Err||(t.streaming?i.value?`failed`:`running…`:`done`));return(t,o)=>e.tool.path?(V(),U(Yee,{key:0,path:e.tool.path,label:e.tool.label},null,8,[`path`,`label`])):(V(),H(`div`,Xee,[G(P(Xd),{"aria-hidden":`true`,class:`size-3.5 shrink-0 self-center text-fg-subtle`}),W(`span`,Zee,M(n.value),1),r.value?(V(),H(`code`,Qee,M(r.value),1)):q(``,!0),W(`span`,{class:j(P(X)(`text-fg-muted`,i.value&&`text-danger`))},M(a.value),3)]))}}),ete={key:0,class:`mb-2 grid gap-0.5 text-xs`},tte={key:1,class:`mb-2 flex flex-wrap gap-1.5`},nte={key:3,class:`whitespace-pre-wrap`},FE=L({__name:`ChatBubble`,props:{text:{},tools:{default:()=>[]},media:{default:()=>[]},assistant:{type:Boolean,default:!1},streaming:{type:Boolean,default:!1}},setup(e){return(t,n)=>(V(),H(`div`,{class:j([`flex`,e.assistant?`justify-start`:`justify-end`])},[W(`div`,{class:j(P(X)(`max-w-[min(78ch,86%)] rounded-[0.85rem] px-4 py-3 leading-normal [overflow-wrap:anywhere]`,e.assistant?`bg-muted`:`bg-primary/15`))},[e.assistant&&e.tools.length?(V(),H(`div`,ete,[(V(!0),H(B,null,R(e.tools,(t,n)=>(V(),U($ee,{key:n,tool:t,streaming:e.streaming},null,8,[`tool`,`streaming`]))),128))])):q(``,!0),e.media.length?(V(),H(`div`,tte,[(V(!0),H(B,null,R(e.media,(e,t)=>(V(),U(vE,{key:t,attachment:e},null,8,[`attachment`]))),128))])):q(``,!0),e.assistant?(V(),U(qee,{key:2,text:e.text},null,8,[`text`])):(V(),H(`div`,nte,M(e.text),1)),z(t.$slots,`default`)],2)],2))}}),rte={class:`w-full self-center justify-self-center py-6 text-center`},ite={class:`grid gap-2`},ate=[`onClick`],ote=
Line truncated
|
||||
`).map(e=>e.trim()).find(Boolean)||``,r=n.length>Aj?`${n.slice(0,Aj).trimEnd()}…`:n;return{text:r,full:t,truncated:r!==t}}var Mj=[`title`],Nj=L({__name:`ActivityRow`,props:{event:{}},emits:[`open`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>nj(n.event)),a=Y(()=>jj(n.event));function o(){i.value>0&&r(`open`,i.value)}let s=Y(()=>n.event.at?uA(n.event.at):`—`);return(e,t)=>(V(),U(P(Dj),{class:j(i.value>0?`cursor-pointer`:``),role:i.value>0?`link`:void 0,tabindex:i.value>0?0:void 0,title:i.value>0?`Open task details`:void 0,onClick:o,onKeydown:[Vl(Bl(o,[`prevent`]),[`enter`]),Vl(Bl(o,[`prevent`]),[`space`])]},{default:F(()=>[G(P(Ej),{class:`font-medium`},{default:F(()=>[K(M(n.event.kind||n.event.type||`event`),1)]),_:1}),G(P(Ej),{class:`font-mono`},{default:F(()=>[K(M(i.value>0?`#${i.value}`:`—`),1)]),_:1}),G(P(Ej),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:a.value.truncated?a.value.full:void 0},M(a.value.text),9,Mj)]),_:1}),G(P(Ej),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1},8,[`class`,`role`,`tabindex`,`title`,`onKeydown`]))}}),Pj=[{value:`all`,label:`All`},{value:`tasks`,label:`Tasks`},{value:`system`,label:`System`}];function Fj(e){return(Number(e?.task_id)||0)>0}function Ij(e,t){return t===`tasks`?Fj(e):t!==`system`||!Fj(e)}function Lj(e,t){return e.filter(e=>Ij(e,t))}function Rj(e,t){return e>0?``:t===`all`?`Waiting for activity`:t===`tasks`?`No task events yet`:`No system events yet`}function zj(e,t){return`${e}:${t??0}`}function Bj(e){let t=[];for(let n of e){let e=n.kind||n.type||`event`,r=Number(n.task_id)||0,i=zj(jj(n).text,r),a=t[t.length-1];if(a&&a.key===i){a.count+=1,a.events.push(n);continue}t.push({key:i,label:e,taskID:r,count:1,representative:n,events:[n]})}return t}var Vj={role:`region`,"aria-label":`Live activity`,"aria-live":`polite`},Hj={class:`max-h-[28rem] overflow-y-auto`},Uj=[`aria-expanded`,`aria-label`,`onClick`],Wj=[`title`],Gj=L({__name:`LiveActivityCard`,setup(e){let t=XE(),{activity:n,streamKind:r,streamState:i}=Pu(fk()),a=N(`all`),o=Y(()=>Lj(n.value,a.value)),s=Y(()=>Rj(o.value.length,a.value)),c=Jt(new Set),l=Y(()=>Bj(o.value));function u(e){c.has(e)?c.delete(e):c.add(e)}function d(e){return c.has(e.key)}function f(e){return jj(e.representative)}function p(e){return e.representative.at?uA(e.representative.at):`—`}function m(e){t.push(`/tasks?task=${encodeURIComponent(e)}`)}return(e,t)=>(V(),U(P(rA),null,{default:F(()=>[G(P(cA),null,{default:F(()=>[G(P(lA),null,{default:F(()=>[...t[1]||=[K(`Live activity`,-1)]]),_:1}),G(P(iA),{class:`flex items-center gap-2`},{default:F(()=>[G(P(Sj),{modelValue:a.value,"onUpdate:modelValue":t[0]||=e=>a.value=e,label:`Filter activity`,options:P(Pj)},null,8,[`modelValue`,`options`]),G(P(eA),{variant:P(r)},{default:F(()=>[K(M(P(i)),1)]),_:1},8,[`variant`])]),_:1})]),_:1}),G(P(aA),null,{default:F(()=>[W(`div`,Vj,[W(`div`,Hj,[G(P(wj),null,{default:F(()=>[G(P(kj),{class:`sticky top-0 z-10 bg-card`},{default:F(()=>[G(P(Dj),null,{default:F(()=>[G(P(Oj),null,{default:F(()=>[...t[2]||=[K(`Event`,-1)]]),_:1}),G(P(Oj),null,{default:F(()=>[...t[3]||=[K(`Task`,-1)]]),_:1}),G(P(Oj),null,{default:F(()=>[...t[4]||=[K(`Detail`,-1)]]),_:1}),G(P(Oj),null,{default:F(()=>[...t[5]||=[K(`When`,-1)]]),_:1})]),_:1})]),_:1}),G(P(Tj),null,{default:F(()=>[o.value.length?q(``,!0):(V(),U(P(Dj),{key:0},{default:F(()=>[G(P(Ej),{colspan:`4`},{default:F(()=>[G(P(Kk),null,{default:F(()=>[G(P(Yk),null,{default:F(()=>[G(P(Qk),null,{default:F(()=>[K(M(s.value),1)]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})),o.value.length?(V(!0),H(B,{key:1},R(l.value,e=>(V(),H(B,{key:e.key},[e.count===1?(V(),U(Nj,{key:0,event:e.representative,onOpen:m},null,8,[`event`])):(V(),H(B,{key:1},[G(P(Dj),{class:j(e.taskID>0?`cursor-pointer`:``),role:e.taskID>0?`link`:void 0,tabindex:e.taskID>0?0:void 0,title:e.taskID>0?`Open task details`:void 0,onClick:t=>e.taskID>0&&m(e.taskID),onKeydown:[Vl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`enter`]),Vl(Bl(t=>e.taskID>0&&m(e.taskID),[`prevent`]),[`space`])]},{default:F(()=>[G(P(Ej),{class:`font-medium`},{default:F(()=>[W(`button`,{type:`button`,class:`inline-flex items-center gap-1 rounded hover:opacity-80`,"aria-expanded":d(e),"aria-label":`${d(e)?`Hide`:`Show`} ${e.count} ${e.label} events`,onClick:Bl(t=>u(e.key),[`stop`])},[d(e)?(V(),U(P(nd),{key:0,class:`size-3.5 shrink-0 text-fg-subtle`})):(V(),U(P(rd),{key:1,class:`size-3.5 shrink-0 text-fg-subtle`})),K(` `+M(e.label)+` `,1),G(P(eA),{variant:`idle`},{default:F(()=>[K(`×`+M(e.count),1)]),_:2},1024)],8,Uj)]),_:2},1024),G(P(Ej),{class:`font-mono`},{default:F(()=>[K(M(e.taskID>0?`#${e.taskID}`:`—`),1)]),_:2},1024),G(P(Ej),{class:`w-[55%] max-w-0`},{default:F(()=>[W(`span`,{class:`block truncate`,title:f(e).truncated?f(e).full:void 0},M(f(e).text),9,Wj)]),_:2},1024),G(P(Ej),null,{default:F(()=>[K(M(p(e)),1)]),_:2},1024)]),_:2},1032,[`class`,`role`,`tabindex`,`title`,`onClick`,`onKeydown`]),d(e)?(V(!0),H(B,{key:0},R(e.events,(t,n)=>(V(),U(Nj,{key:`${e.key}:${n}`,ev
Line truncated
|
||||
`)){let e=n.indexOf(`:`);if(e<=0)continue;let r=n.slice(0,e).trim();r&&(t[r]=n.slice(e+1).trim())}return t}function fN(e,t){if(!e.event_type)return{label:`Unidentified`,identified:!1};let n=t.find(t=>t.id===e.event_type);return{label:n?n.name:`Deleted type`,identified:!0}}function pN(e,t){if(!e)return`No event type`;let n=t.find(t=>t.id===e);return n?`${n.source} / ${n.name}`:`Deleted type`}function mN(e){let t=[...(e.headers||[]).map(e=>`${e.name} = ${e.value}`),...(e.payload||[]).map(e=>e.op===`present`?`${e.path} present`:`${e.path} = ${e.value??``}`)];return t.length?t.join(` · `):`any event`}function hN(e){return{headers:(e.headers||[]).filter(e=>e.name.trim()!==``).map(e=>({name:e.name.trim(),value:e.value})),payload:(e.payload||[]).filter(e=>e.path.trim()!==``).map(e=>e.op===`present`?{path:e.path.trim(),op:e.op}:{path:e.path.trim(),op:e.op,value:e.value??``})}}var gN=N([]),_N=N([]),vN=N(!0),yN=N(null),bN=N(null),xN=N(!1),SN=N(null);async function CN(){try{let e=await Z.eventTypes();vN.value=e.enabled!==!1,gN.value=e.event_types||[],_N.value=e.proposals||[],yN.value=null}catch(e){yN.value=e.message||String(e)}}function wN(e){return{headers:(e.headers||[]).map(e=>({...e})),payload:(e.payload||[]).map(e=>({...e}))}}function TN(e){SN.value=null,bN.value=e}function EN(e){let t=PN.value.find(t=>String(t.id)===e.sample_id);TN({mode:`proposal`,id:null,source:e.source,name:``,rule:wN(e.rule),headersText:``,body:t?.body||``,exampleHeaders:e.headers||{}})}function DN(e=``){TN({mode:`paste`,id:null,source:e,name:``,rule:{headers:[],payload:[]},headersText:``,body:``,exampleHeaders:{}})}function ON(e){TN({mode:`edit`,id:e.id,source:e.source,name:e.name,rule:wN(e.rule),headersText:``,body:``,exampleHeaders:{}})}function kN(){bN.value=null}async function AN(){let e=bN.value;if(e){xN.value=!0;try{if(e.mode===`edit`&&e.id)await Z.eventTypeUpdate(e.id,{name:e.name,rule:hN(e.rule)});else{let t=e.mode===`paste`?dN(e.headersText):e.exampleHeaders;await Z.eventTypeCreate({source:e.source,name:e.name,rule:e.mode===`paste`?void 0:hN(e.rule),example:{headers:t,body:e.body}})}bN.value=null,await CN()}catch(e){SN.value=e.message||String(e)}finally{xN.value=!1}}}var jN=N(null);async function MN(){let e=jN.value;if(jN.value=null,e)try{await Z.eventTypeDelete(e.id),await CN()}catch(e){yN.value=e.message||String(e)}}var NN=100,PN=N([]),FN=N(!0),IN=N(null),LN=N(!0),RN=N(null);async function zN(){try{let e=await Z.captures(NN);FN.value=e.enabled!==!1,PN.value=e.captures||[],IN.value=null}catch(e){IN.value=e.message||String(e)}finally{LN.value=!1}}function BN(e){let t=PN.value.find(t=>t.id===e);return t&&(RN.value=t),!!t}function VN(){PN.value.length&&(RN.value=PN.value[0])}function HN(){pk(`captures`,()=>{zN(),CN()})}var UN=`archie.theme`,WN=`archie.density`,GN=`archie.motion`,KN=`archie.tooltips`;function qN(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function JN(e,t){try{localStorage.setItem(e,t)}catch{}}function YN(e){if(e!==`system`)return e;try{return matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}catch{return`dark`}}var XN=Nu(`appearance`,()=>{let e=N(qN(UN,[`system`,`dark`,`light`],`dark`)),t=N(qN(WN,[`comfortable`,`compact`],`comfortable`)),n=N(qN(GN,[`system`,`reduced`],`system`)),r=N(qN(KN,[`on`,`off`],`on`)===`on`),i=!1;function a(){document.documentElement.dataset.theme=YN(e.value)}function o(t){e.value=t,a(),JN(UN,t)}function s(e){t.value=e,document.documentElement.dataset.density=e,JN(WN,e)}function c(e){n.value=e,document.documentElement.dataset.motion=e,JN(GN,e)}function l(e){r.value=e,JN(KN,e?`on`:`off`)}function u(){if(!i){i=!0,a(),document.documentElement.dataset.density=t.value,document.documentElement.dataset.motion=n.value;try{matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,()=>{e.value===`system`&&a()})}catch{}}}return{theme:e,density:t,motion:n,tooltipsEnabled:r,initialize:u,setTheme:o,setDensity:s,setMotion:c,setTooltips:l}}),ZN=L({__name:`Tooltip`,props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:[`update:open`],setup(e,{emit:t}){let n=e,r=Jh(n,t),{tooltipsEnabled:i}=Pu(XN());return(e,t)=>(V(),U(P(YC),J({"data-slot":`tooltip`},P(r),{disabled:n.disabled||!P(i)}),{default:F(t=>[z(e.$slots,`default`,ve(cs(t)))]),_:3},16,[`disabled`]))}}),QN=L({inheritAttrs:!1,__name:`TooltipContent`,props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:0},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:[`escapeKeyDown`,`pointerDownOutside`],setup(e,{emit:t}){let n=e,r=t,i=Jh(hw(n,`class`),r);return(e,t)=>(V(),U(P($C),null,{default:F(
Line truncated
|
||||
`)}};cJ.defaultYaml={explicit:!1,version:`1.2`},cJ.defaultTags={"!!":`tag:yaml.org,2002:`};function lJ(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function uJ(e){let t=new Set;return tJ(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function dJ(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function fJ(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=uJ(e);let a=dJ(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(qq(t.node)||Yq(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function pJ(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=pJ(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=pJ(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=pJ(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=pJ(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function mJ(e,t,n){if(Array.isArray(e))return e.map((e,t)=>mJ(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Zq(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!n?.keep?Number(e):e}var hJ=class{constructor(e){Object.defineProperty(this,Hq,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Wq(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=mJ(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?pJ(i,{"":o},``,o):o}},gJ=class extends hJ{constructor(e){super(Iq),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError(`Alias resolution is disabled`);let n;t?.aliasResolveCache?n=t.aliasResolveCache:(n=[],tJ(e,{Node:(e,t)=>{(Uq(t)||Zq(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(mJ(r,null,t),e.get(r)),a?.res===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=_J(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(lJ(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function _J(e,t,n){if(Uq(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Yq(t)){let r=0;for(let i of t.items){let t=_J(e,i,n);t>r&&(r=t)}return r}if(Kq(t)){let r=_J(e,t.key,n),i=_J(e,t.value,n);return Math.max(r,i)}return 1}var vJ=e=>!e||typeof e!=`function`&&typeof e!=`object`,yJ=class extends hJ{constructor(e){super(Bq),this.value=e}toJSON(e,t){return t?.keep?this.value:mJ(this.value,e,t)}toString(){return String(this.value)}};yJ.BLOCK_FOLDED=`BLOCK_FOLDED`,yJ.BLOCK_LITERAL=`BLOCK_LITERAL`,yJ.PLAIN=`PLAIN`,yJ.QUOTE_DOUBLE=`QUOTE_DOUBLE`,yJ.QUOTE_SINGLE=`QUOTE_SINGLE`;var bJ=`tag:yaml.org,2002:`;function xJ(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>t.identify?.(e)&&!t.format)}function SJ(e,t,n){if(Wq(e)&&(e=e.contents),Xq(e))return e;if(Kq(e)){let t=n.schema[Rq].createNode?.(n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:r,onAnchor:i,onTagObj:a,schema:o,sourceObjects:s}=n,c;if(r&&e&&typeof e==`object`){if(c=s.get(e),c)return c.anchor??(c.anchor=i(e)),new gJ(c.anchor);c={anchor:null,node:null},s.set(e,c)}t?.startsWith(`!!`)&&(t=bJ+t.slice(2));let l=xJ(e,t,o.tags);if(!l){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new yJ(e);return c&&(c.node=t),t
Line truncated
|
||||
`)?DJ(n,t):n.includes(`
|
||||
`)?`
|
||||
`+OJ(n,t):(e.endsWith(` `)?``:` `)+n,AJ=`flow`,jJ=`block`,MJ=`quoted`;function NJ(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=PJ(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
||||
`)n===`block`&&(h=PJ(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`+DJ(n,t):(e.endsWith(` `)?``:` `)+n,kJ=`flow`,AJ=`block`,jJ=`quoted`;function MJ(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=NJ(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
||||
`)n===`block`&&(h=NJ(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
||||
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
||||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function PJ(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
||||
`);r=t,i=t+1,a=e[i]}return r}var FJ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),IJ=e=>/^(%|---|\.\.\.)/m.test(e);function LJ(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
||||
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function RJ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(IJ(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||||
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function NJ(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
||||
`);r=t,i=t+1,a=e[i]}return r}var PJ=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),FJ=e=>/^(%|---|\.\.\.)/m.test(e);function IJ(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
||||
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function LJ(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(FJ(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
||||
|
||||
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
||||
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:NJ(o,a,MJ,FJ(t,!1))}function zJ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return RJ(e,t);let n=t.indent||(IJ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:NJ(r,n,AJ,FJ(t,!1))}function BJ(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=RJ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?zJ:i&&!t?RJ:n?zJ:RJ}return r(e,t)}var VJ;try{VJ=RegExp(`(^|(?<!
|
||||
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:MJ(o,a,jJ,PJ(t,!1))}function RJ(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
||||
`)||/[ \t]\n|\n[ \t]/.test(e))return LJ(e,t);let n=t.indent||(FJ(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:MJ(r,n,kJ,PJ(t,!1))}function zJ(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=LJ;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?RJ:i&&!t?LJ:n?RJ:LJ}return r(e,t)}var BJ;try{BJ=RegExp(`(^|(?<!
|
||||
))
|
||||
+(?!
|
||||
|$)`,`g`)}catch{VJ=/\n+(?!\n|$)/g}function HJ({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return BJ(n,r);let l=r.indent||(r.forceBlockIndent||IJ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===bJ.BLOCK_FOLDED?!1:t===bJ.BLOCK_LITERAL||!LJ(n,c,l.length);if(!n)return u?`|
|
||||
|$)`,`g`)}catch{BJ=/\n+(?!\n|$)/g}function VJ({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return zJ(n,r);let l=r.indent||(r.forceBlockIndent||FJ(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===yJ.BLOCK_FOLDED?!1:t===yJ.BLOCK_LITERAL||!IJ(n,c,l.length);if(!n)return u?`|
|
||||
`:`>
|
||||
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
||||
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
||||
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
||||
`&&(p=p.slice(0,-1)),p.replace(VJ,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
||||
`&&(p=p.slice(0,-1)),p.replace(BJ,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
||||
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
||||
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=FJ(r,!0);o!==`folded`&&t!==bJ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=NJ(`${v}${e}${p}`,l,jJ,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function UJ(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
||||
`)||u&&/[[\]{},]/.test(a))return BJ(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?BJ(a,t):HJ(e,t,n,r);if(!s&&!u&&i!==bJ.PLAIN&&a.includes(`
|
||||
`))return HJ(e,t,n,r);if(IJ(a)){if(c===``)return t.forceBlockIndent=!0,HJ(e,t,n,r);if(s&&c===l)return BJ(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return BJ(a,t)}return s?d:NJ(d,c,AJ,FJ(t,!1))}function WJ(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==bJ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=bJ.QUOTE_DOUBLE);let c=e=>{switch(e){case bJ.BLOCK_FOLDED:case bJ.BLOCK_LITERAL:return i||a?BJ(o.value,t):HJ(o,t,n,r);case bJ.QUOTE_DOUBLE:return RJ(o.value,t);case bJ.QUOTE_SINGLE:return zJ(o.value,t);case bJ.PLAIN:return UJ(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function GJ(e,t){let n=Object.assign({blockQuote:!0,commentString:DJ,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function KJ(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(Jq(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function qJ(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(Jq(e)||Xq(e))&&e.anchor;a&&uJ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function JJ(e,t,n,r){if(qq(e))return e.toString(t,n,r);if(Wq(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Zq(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=KJ(t.doc.schema.tags,a);let o=qJ(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):Jq(a)?WJ(a,t,n,r):a.toString(t,n,r);return o?Jq(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function YJ({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Zq(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Xq(e)||!Zq(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Xq(e)||(Jq(e)?e.type===bJ.BLOCK_FOLDED||e.type===bJ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=JJ(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=kJ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=kJ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=kJ(g,n.indent,l(f))));let _,v,y;Zq(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&Jq(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Yq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=JJ(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${OJ(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=PJ(r,!0);o!==`folded`&&t!==yJ.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=MJ(`${v}${e}${p}`,l,AJ,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function HJ(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
||||
`)||u&&/[[\]{},]/.test(a))return zJ(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
||||
`)?zJ(a,t):VJ(e,t,n,r);if(!s&&!u&&i!==yJ.PLAIN&&a.includes(`
|
||||
`))return VJ(e,t,n,r);if(FJ(a)){if(c===``)return t.forceBlockIndent=!0,VJ(e,t,n,r);if(s&&c===l)return zJ(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>e.default&&e.tag!==`tag:yaml.org,2002:str`&&e.test?.test(d),{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n?.some(e))return zJ(a,t)}return s?d:MJ(d,c,kJ,PJ(t,!1))}function UJ(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==yJ.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=yJ.QUOTE_DOUBLE);let c=e=>{switch(e){case yJ.BLOCK_FOLDED:case yJ.BLOCK_LITERAL:return i||a?zJ(o.value,t):VJ(o,t,n,r);case yJ.QUOTE_DOUBLE:return LJ(o.value,t);case yJ.QUOTE_SINGLE:return RJ(o.value,t);case yJ.PLAIN:return HJ(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function WJ(e,t){let n=Object.assign({blockQuote:!0,commentString:EJ,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function GJ(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(qq(t)){r=t.value;let i=e.filter(e=>e.identify?.(r));if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){let e=r?.constructor?.name??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function KJ(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(qq(e)||Yq(e))&&e.anchor;a&&lJ(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function qJ(e,t,n,r){if(Kq(e))return e.toString(t,n,r);if(Uq(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let i,a=Xq(e)?e:t.doc.createNode(e,{onTagObj:e=>i=e});i??=GJ(t.doc.schema.tags,a);let o=KJ(a,i,t);o.length>0&&(t.indentAtStart=(t.indentAtStart??0)+o.length+1);let s=typeof i.stringify==`function`?i.stringify(a,t,n,r):qq(a)?UJ(a,t,n,r):a.toString(t,n,r);return o?qq(a)||s[0]===`{`||s[0]===`[`?`${o} ${s}`:`${o}\n${t.indent}${s}`:s}function JJ({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Xq(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Yq(e)||!Xq(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Yq(e)||(qq(e)?e.type===yJ.BLOCK_FOLDED||e.type===yJ.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=qJ(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=OJ(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=OJ(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=OJ(g,n.indent,l(f))));let _,v,y;Xq(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&qq(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Jq(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let b=!1,x=qJ(t,n,()=>b=!0,()=>h=!0),S=` `;if(f||_||v){if(S=_?`
|
||||
`:``,v){let e=l(v);S+=`\n${DJ(e,n.indent)}`}x===``&&!n.inFlow?S===`
|
||||
`&&y&&(S=`
|
||||
|
||||
`):S+=`\n${n.indent}`}else if(!p&&Xq(t)){let e=x[0],r=x.indexOf(`
|
||||
`):S+=`\n${n.indent}`}else if(!p&&Yq(t)){let e=x[0],r=x.indexOf(`
|
||||
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=x.indexOf(` `);e===`&`&&n!==-1&&n<r&&x[n+1]===`!`&&(n=x.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(S=`\n${n.indent}`)}}else(x===``||x[0]===`
|
||||
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=kJ(g,n.indent,l(y)):h&&i&&i(),g}function XJ(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var ZJ=`<<`,QJ={identify:e=>e===ZJ||typeof e==`symbol`&&e.description===ZJ,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new bJ(Symbol(ZJ)),{addToJSMap:eY}),stringify:()=>ZJ},$J=(e,t)=>(QJ.identify(t)||Jq(t)&&(!t.type||t.type===bJ.PLAIN)&&QJ.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===QJ.tag&&e.default);function eY(e,t,n){let r=nY(e,n);if(Yq(r))for(let n of r.items)tY(e,t,n);else if(Array.isArray(r))for(let n of r)tY(e,t,n);else tY(e,t,r)}function tY(e,t,n){let r=nY(e,n);if(!Kq(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function nY(e,t){return e&&Wq(t)?t.resolve(e.doc,e):t}function rY(e,t,{key:n,value:r}){if(Zq(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if($J(e,n))eY(e,t,r);else{let i=hJ(n,``,e);if(t instanceof Map)t.set(i,hJ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=iY(n,i,e),o=hJ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function iY(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Zq(e)&&n?.doc){let t=GJ(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),XJ(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function aY(e,t,n){return new oY(CJ(e,void 0,n),CJ(t,void 0,n))}var oY=class e{constructor(e,t=null){Object.defineProperty(this,Uq,{value:Bq}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Zq(n)&&(n=n.clone(t)),Zq(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return rY(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?YJ(this,e,t,n):JSON.stringify(this)}};function sY(e,t,n){return(t.inFlow??e.flow?lY:cY)(e,t,n)}function cY({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Zq(i))!d&&i.spaceBefore&&f.push(``),uY(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(qq(i)){let e=Zq(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),uY(n,f,e.commentBefore,d))}d=!1;let s=JJ(i,u,()=>o=null,()=>d=!0);o&&(s+=kJ(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
||||
`)&&(S=``);return g+=S+x,n.inFlow?b&&r&&r():y&&!b?g+=OJ(g,n.indent,l(y)):h&&i&&i(),g}function YJ(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var XJ=`<<`,ZJ={identify:e=>e===XJ||typeof e==`symbol`&&e.description===XJ,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new yJ(Symbol(XJ)),{addToJSMap:$J}),stringify:()=>XJ},QJ=(e,t)=>(ZJ.identify(t)||qq(t)&&(!t.type||t.type===yJ.PLAIN)&&ZJ.identify(t.value))&&e?.doc.schema.tags.some(e=>e.tag===ZJ.tag&&e.default);function $J(e,t,n){let r=tY(e,n);if(Jq(r))for(let n of r.items)eY(e,t,n);else if(Array.isArray(r))for(let n of r)eY(e,t,n);else eY(e,t,r)}function eY(e,t,n){let r=tY(e,n);if(!Gq(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function tY(e,t){return e&&Uq(t)?t.resolve(e.doc,e):t}function nY(e,t,{key:n,value:r}){if(Xq(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(QJ(e,n))$J(e,t,r);else{let i=mJ(n,``,e);if(t instanceof Map)t.set(i,mJ(r,i,e));else if(t instanceof Set)t.add(i);else{let a=rY(n,i,e),o=mJ(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function rY(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Xq(e)&&n?.doc){let t=WJ(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),YJ(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function iY(e,t,n){return new aY(SJ(e,void 0,n),SJ(t,void 0,n))}var aY=class e{constructor(e,t=null){Object.defineProperty(this,Hq,{value:zq}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Xq(n)&&(n=n.clone(t)),Xq(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return nY(t,t?.mapAsMap?new Map:{},this)}toString(e,t,n){return e?.doc?JJ(this,e,t,n):JSON.stringify(this)}};function oY(e,t,n){return(t.inFlow??e.flow?cY:sY)(e,t,n)}function sY({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Xq(i))!d&&i.spaceBefore&&f.push(``),lY(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Kq(i)){let e=Xq(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),lY(n,f,e.commentBefore,d))}d=!1;let s=qJ(i,u,()=>o=null,()=>d=!0);o&&(s+=OJ(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
||||
`}}return e?(p+=`
|
||||
`+OJ(l(e),c),s&&s()):d&&o&&o(),p}function lY({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Zq(i))i.spaceBefore&&d.push(``),uY(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(qq(i)){let e=Zq(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),uY(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Zq(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=JJ(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
||||
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=kJ(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
||||
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function uY({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=OJ(t(r),e);n.push(i.trimStart())}}function dY(e,t){let n=Jq(t)?t.value:t;for(let r of e)if(qq(r)&&(r.key===t||r.key===n||Jq(r.key)&&r.key.value===n))return r}var fY=class extends EJ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(zq,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(aY(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=qq(e)?e:!e||typeof e!=`object`||!(`key`in e)?new oY(e,e?.value):new oY(e.key,e.value);let r=dY(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);Jq(r.value)&&yJ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=dY(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=dY(this.items,e)?.value;return(!t&&Jq(n)?n.value:n)??void 0}has(e){return!!dY(this.items,e)}set(e,t){this.add(new oY(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)rY(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!qq(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),sY(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},pY={collection:`map`,default:!0,nodeClass:fY,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Kq(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>fY.from(e,t,n)},mY=class extends EJ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Hq,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=hY(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=hY(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&Jq(r)?r.value:r}has(e){let t=hY(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=hY(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];Jq(r)&&yJ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(hJ(e,String(r++),t));return n}toString(e,t,n){return e?sY(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(CJ(a,void 0,n))}}return i}};function hY(e){let t=Jq(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var gY={collection:`seq`,default:!0,nodeClass:mY,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Yq(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>mY.from(e,t,n)},_Y={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),WJ(e,t,n,r)}},vY={identify:e=>e==null,createNode:()=>new bJ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new bJ(null),stringify:({source:e},t)=>typeof e==`string`&&vY.test.test(e)?e:t.options.nullStr},yY={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new bJ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&yY.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function bY({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var xY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:bY},SY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string
Line truncated
|
||||
`:` `)}return WJ({comment:e,type:t,value:s},r,i,a)}};function IY(e,t){if(Yq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!qq(r)){if(Kq(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new oY(new bJ(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=qq(r)?r:new oY(r)}}else t(`Expected a sequence for this tag`);return e}function LY(e,t,n){let{replacer:r}=n,i=new mY(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(aY(o,s,n))}return i}var RY={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:IY,createNode:LY},zY=class e extends mY{constructor(){super(),this.add=fY.prototype.add.bind(this),this.delete=fY.prototype.delete.bind(this),this.get=fY.prototype.get.bind(this),this.has=fY.prototype.has.bind(this),this.set=fY.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(qq(e)?(r=hJ(e.key,``,t),i=hJ(e.value,r,t)):r=hJ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=LY(e,t,n),i=new this;return i.items=r.items,i}};zY.tag=`tag:yaml.org,2002:omap`;var BY={collection:`seq`,identify:e=>e instanceof Map,nodeClass:zY,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=IY(e,t),r=[];for(let{key:e}of n.items)Jq(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new zY,n)},createNode:(e,t,n)=>zY.from(e,t,n)};function VY({value:e,source:t},n){return t&&(e?HY:UY).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var HY={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new bJ(!0),stringify:VY},UY={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new bJ(!1),stringify:VY},WY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:bY},GY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():bY(e)}},KY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new bJ(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:bY},qY=e=>typeof e==`bigint`||Number.isInteger(e);function JY(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function YY(e,t,n){let{value:r}=e;if(qY(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return bY(e)}var XY={identify:qY,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>JY(e,2,2,n),stringify:e=>YY(e,2,`0b`)},ZY={identify:qY,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>JY(e,1,8,n),stringify:e=>YY(e,8,`0`)},QY={identify:qY,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>JY(e,0,10,n),stringify:bY},$Y={identify:qY,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>JY(e,2,16,n),stringify:e=>YY(e,16,`0x`)},eX=class e extends fY{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=qq(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new oY(e.key,null):new oY(e,null),dY(this.items,t.key)||this.items.push(t)}get(e,t){let n=dY(this.items,e);return!t&&qq(n)?Jq(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=dY(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new oY(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s
Line truncated
|
||||
`)?(n.push(`...`),n.push(OJ(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(OJ(a(t),``)))}return n.join(`
|
||||
`+DJ(l(e),c),s&&s()):d&&o&&o(),p}function cY({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Xq(i))i.spaceBefore&&d.push(``),lY(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Kq(i)){let e=Xq(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),lY(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Xq(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e?.comment&&(a=e.comment)}a&&(l=!0);let o=qJ(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
||||
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=OJ(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
||||
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function lY({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=DJ(t(r),e);n.push(i.trimStart())}}function uY(e,t){let n=qq(t)?t.value:t;for(let r of e)if(Kq(r)&&(r.key===t||r.key===n||qq(r.key)&&r.key.value===n))return r}var dY=class extends TJ{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Rq,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(iY(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){let n;n=Kq(e)?e:!e||typeof e!=`object`||!(`key`in e)?new aY(e,e?.value):new aY(e.key,e.value);let r=uY(this.items,n.key),i=this.schema?.sortMapEntries;if(r){if(!t)throw Error(`Key ${n.key} already set`);qq(r.value)&&vJ(n.value)?r.value.value=n.value:r.value=n.value}else if(i){let e=this.items.findIndex(e=>i(n,e)<0);e===-1?this.items.push(n):this.items.splice(e,0,n)}else this.items.push(n)}delete(e){let t=uY(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=uY(this.items,e)?.value;return(!t&&qq(n)?n.value:n)??void 0}has(e){return!!uY(this.items,e)}set(e,t){this.add(new aY(e,t),!0)}toJSON(e,t,n){let r=n?new n:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(let e of this.items)nY(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Kq(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),oY(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},fY={collection:`map`,default:!0,nodeClass:dY,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Gq(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>dY.from(e,t,n)},pY=class extends TJ{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Vq,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=mY(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=mY(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&qq(r)?r.value:r}has(e){let t=mY(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=mY(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];qq(r)&&vJ(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t?.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(mJ(e,String(r++),t));return n}toString(e,t,n){return e?oY(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(SJ(a,void 0,n))}}return i}};function mY(e){let t=qq(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var hY={collection:`seq`,default:!0,nodeClass:pY,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Jq(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>pY.from(e,t,n)},gY={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),UJ(e,t,n,r)}},_Y={identify:e=>e==null,createNode:()=>new yJ(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new yJ(null),stringify:({source:e},t)=>typeof e==`string`&&_Y.test.test(e)?e:t.options.nullStr},vY={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new yJ(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&vY.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function yY({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var bY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:yY},xY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),string
Line truncated
|
||||
`:` `)}return UJ({comment:e,type:t,value:s},r,i,a)}};function FY(e,t){if(Jq(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Kq(r)){if(Gq(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new aY(new yJ(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Kq(r)?r:new aY(r)}}else t(`Expected a sequence for this tag`);return e}function IY(e,t,n){let{replacer:r}=n,i=new pY(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(iY(o,s,n))}return i}var LY={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:FY,createNode:IY},RY=class e extends pY{constructor(){super(),this.add=dY.prototype.add.bind(this),this.delete=dY.prototype.delete.bind(this),this.get=dY.prototype.get.bind(this),this.has=dY.prototype.has.bind(this),this.set=dY.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t?.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Kq(e)?(r=mJ(e.key,``,t),i=mJ(e.value,r,t)):r=mJ(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=IY(e,t,n),i=new this;return i.items=r.items,i}};RY.tag=`tag:yaml.org,2002:omap`;var zY={collection:`seq`,identify:e=>e instanceof Map,nodeClass:RY,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=FY(e,t),r=[];for(let{key:e}of n.items)qq(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new RY,n)},createNode:(e,t,n)=>RY.from(e,t,n)};function BY({value:e,source:t},n){return t&&(e?VY:HY).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var VY={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new yJ(!0),stringify:BY},HY={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new yJ(!1),stringify:BY},UY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:yY},WY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():yY(e)}},GY={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new yJ(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:yY},KY=e=>typeof e==`bigint`||Number.isInteger(e);function qY(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function JY(e,t,n){let{value:r}=e;if(KY(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return yY(e)}var YY={identify:KY,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>qY(e,2,2,n),stringify:e=>JY(e,2,`0b`)},XY={identify:KY,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>qY(e,1,8,n),stringify:e=>JY(e,8,`0`)},ZY={identify:KY,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>qY(e,0,10,n),stringify:yY},QY={identify:KY,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>qY(e,2,16,n),stringify:e=>JY(e,16,`0x`)},$Y=class e extends dY{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Kq(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new aY(e.key,null):new aY(e,null),uY(this.items,t.key)||this.items.push(t)}get(e,t){let n=uY(this.items,e);return!t&&Kq(n)?qq(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=uY(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new aY(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return s
Line truncated
|
||||
`)?(n.push(`...`),n.push(DJ(t,``))):n.push(`... ${t}`)}else n.push(`...`)}else{let t=e.comment;t&&o&&(t=t.replace(/^\n+/,``)),t&&((!o||s)&&n[n.length-1]!==``&&n.push(``),n.push(DJ(a(t),``)))}return n.join(`
|
||||
`)+`
|
||||
`}var hX=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Uq,{value:Rq});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new lJ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Uq]:{value:Rq}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Zq(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){gX(this.contents)&&this.contents.add(e)}addIn(e,t){gX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=dJ(this);e.anchor=!t||n.has(t)?fJ(t||`a`,n):t}return new _J(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=pJ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=CJ(e,l,p);return o&&Xq(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new oY(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return gX(this.contents)?this.contents.delete(e):!1}deleteIn(e){return TJ(e)?this.contents!=null&&(this.contents=null,!0):gX(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Xq(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return TJ(e)?!t&&Jq(this.contents)?this.contents.value:this.contents:Xq(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Xq(this.contents)?this.contents.has(e):!1}hasIn(e){return TJ(e)?this.contents!==void 0:Xq(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=wJ(this.schema,[e],t):gX(this.contents)&&this.contents.set(e,t)}setIn(e,t){TJ(e)?this.contents=t:this.contents==null?this.contents=wJ(this.schema,Array.from(e),t):gX(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new lJ({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new lJ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new pX(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=hJ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?mJ(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return mX(this,e)}};function gX(e){if(Xq(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var _X=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},vX=class extends _X{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},yX=class extends _X{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},bX=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
||||
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function xX(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function SX(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
||||
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(SX(t.key)||SX(t.value))return!0}return!1;default:return!0}}function CX(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&SX(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function wX(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||Jq(e)&&Jq(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var TX=`All mapping items must start at the same column`;function EX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??fY)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=xX(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,TX)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||SX(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,TX);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&CX(r.indent,u,i),n.atKey=!1,wX(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=xX(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&CX(r.indent,f,i),s=c.range[2];let l=new oY(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let e=new oY(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function DX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??mY)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=xX(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&CX(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function OX(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var kX=`Block collections are not allowed within flow collections`,AX=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function jX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?fY:mY))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=xX(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
||||
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&SX(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];qq(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
||||
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],AX(m)&&i(r.range,`BLOCK_IN_FLOW`,kX)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);AX(f)&&i(g.range,`BLOCK_IN_FLOW`,kX),n.atKey=!1;let _=xX(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?AX(m)&&i(v.range,`BLOCK_IN_FLOW`,kX):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new oY(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;wX(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new fY(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=OX(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
||||
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function MX(e,t,n,r,i,a){let o=n.type===`block-map`?EX(e,t,n,r,a):n.type===`block-seq`?DX(e,t,n,r,a):jX(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function NX(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===fY.tagName&&s===`map`||o===mY.tagName&&s===`seq`)return MX(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),MX(e,t,n,i,o)}let l=MX(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Zq(u)?u:new bJ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function PX(e,t,n){let r=t.offset,i=FX(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?bJ.BLOCK_FOLDED:bJ.BLOCK_LITERAL,o=t.source?IX(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
||||
`}var mX=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Hq,{value:Lq});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n?._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new cJ({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[Hq]:{value:Lq}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Xq(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){hX(this.contents)&&this.contents.add(e)}addIn(e,t){hX(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=uJ(this);e.anchor=!t||n.has(t)?dJ(t||`a`,n):t}return new gJ(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=fJ(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=SJ(e,l,p);return o&&Yq(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new aY(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return hX(this.contents)?this.contents.delete(e):!1}deleteIn(e){return wJ(e)?this.contents!=null&&(this.contents=null,!0):hX(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Yq(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return wJ(e)?!t&&qq(this.contents)?this.contents.value:this.contents:Yq(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Yq(this.contents)?this.contents.has(e):!1}hasIn(e){return wJ(e)?this.contents!==void 0:Yq(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=CJ(this.schema,[e],t):hX(this.contents)&&this.contents.set(e,t)}setIn(e,t){wJ(e)?this.contents=t:this.contents==null?this.contents=CJ(this.schema,Array.from(e),t):hX(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new cJ({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new cJ({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new fX(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=mJ(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?pJ(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return pX(this,e)}};function hX(e){if(Yq(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var gX=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},_X=class extends gX{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},vX=class extends gX{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},yX=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
||||
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];t?.line===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function bX(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,b=null,x=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||r?.type!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!b||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,x??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,x??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),b&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),b=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let S=e[e.length-1],C=S?S.offset+S.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||r?.type===`block-map`||r?.type===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:b,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:C,start:x??C}}function xX(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
||||
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(xX(t.key)||xX(t.value))return!0}return!1;default:return!0}}function SX(e,t,n){if(t?.type===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&xX(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function CX(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||qq(e)&&qq(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var wX=`All mapping items must start at the same column`;function TX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??dY)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){let{start:l,key:u,sep:d,value:f}=a,p=bX(l,{indicator:`explicit-key-ind`,next:u??d?.[0],offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),m=!p.found;if(m){if(u&&(u.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in u&&u.indent!==r.indent&&i(s,`BAD_INDENT`,wX)),!p.anchor&&!p.tag&&!d){c=p.end,p.comment&&(o.comment?o.comment+=`
|
||||
`+p.comment:o.comment=p.comment);continue}(p.newlineAfterProp||xX(u))&&i(u??l[l.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else p.found?.indent!==r.indent&&i(s,`BAD_INDENT`,wX);n.atKey=!0;let h=p.end,g=u?e(n,u,p,i):t(n,h,l,null,p,i);n.schema.compat&&SX(r.indent,u,i),n.atKey=!1,CX(n,o.items,g)&&i(h,`DUPLICATE_KEY`,`Map keys must be unique`);let _=bX(d??[],{indicator:`map-value-ind`,next:f,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!u||u.type===`block-scalar`});if(s=_.end,_.found){m&&(f?.type===`block-map`&&!_.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&p.start<_.found.offset-1024&&i(g.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=f?e(n,f,_,i):t(n,s,d,null,_,i);n.schema.compat&&SX(r.indent,f,i),s=c.range[2];let l=new aY(g,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{m&&i(g.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let e=new aY(g);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function EX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a?.nodeClass)??pY)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=bX(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)l?.type===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&SX(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function DX(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var OX=`Block collections are not allowed within flow collections`,kX=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function AX({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a?.nodeClass)??(o?dY:pY))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:d,key:f,sep:p,value:m}=l,h=bX(d,{flow:s,indicator:`explicit-key-ind`,next:f??p?.[0],offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!h.found){if(!h.anchor&&!h.tag&&!p&&!m){a===0&&h.comma?i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(h.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),h.comment&&(c.comment?c.comment+=`
|
||||
`+h.comment:c.comment=h.comment),u=h.end;continue}!o&&n.options.strict&&xX(f)&&i(f,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)h.comma&&i(h.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(h.comma||i(h.start,`MISSING_CHAR`,`Missing , between ${s} items`),h.comment){let e=``;loop:for(let t of d)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Kq(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
||||
`+e:t.comment=e,h.comment=h.comment.substring(e.length+1)}}if(!o&&!p&&!h.found){let r=m?e(n,m,h,i):t(n,h.end,p,null,h,i);c.items.push(r),u=r.range[2],kX(m)&&i(r.range,`BLOCK_IN_FLOW`,OX)}else{n.atKey=!0;let a=h.end,g=f?e(n,f,h,i):t(n,a,d,null,h,i);kX(f)&&i(g.range,`BLOCK_IN_FLOW`,OX),n.atKey=!1;let _=bX(p??[],{flow:s,indicator:`map-value-ind`,next:m,offset:g.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(_.found){if(!o&&!h.found&&n.options.strict){if(p)for(let e of p){if(e===_.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}h.start<_.found.offset-1024&&i(_.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else m&&(`source`in m&&m.source?.[0]===`:`?i(m,`MISSING_CHAR`,`Missing space after : in ${s}`):i(_.start,`MISSING_CHAR`,`Missing , or : between ${s} items`));let v=m?e(n,m,_,i):_.found?t(n,_.end,p,null,_,i):null;v?kX(m)&&i(v.range,`BLOCK_IN_FLOW`,OX):_.comment&&(g.comment?g.comment+=`
|
||||
`+_.comment:g.comment=_.comment);let y=new aY(g,v);if(n.options.keepSourceTokens&&(y.srcToken=l),o){let e=c;CX(n,e.items,g)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(y)}else{let e=new dY(n.schema);e.flow=!0,e.items.push(y);let t=(v??g).range;e.range=[g.range[0],t[1],t[2]],c.items.push(e)}u=v?v.range[2]:_.end}}let d=o?`}`:`]`,[f,...p]=r.end,m=u;if(f?.source===d)m=f.offset+f.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${d}`:`${e} in block collection must be sufficiently indented and end with a ${d}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),f&&f.source.length!==1&&p.unshift(f)}if(p.length>0){let e=DX(p,m,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
||||
`+e.comment:c.comment=e.comment),c.range=[r.offset,m,e.offset]}else c.range=[r.offset,m,m];return c}function jX(e,t,n,r,i,a){let o=n.type===`block-map`?TX(e,t,n,r,a):n.type===`block-seq`?EX(e,t,n,r,a):AX(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function MX(e,t,n,r,i){let a=r.tag,o=a?t.directives.tagName(a.source,e=>i(a,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&a?e.offset>a.offset?e:a:e??a;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let s=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!a||!o||o===`!`||o===dY.tagName&&s===`map`||o===pY.tagName&&s===`seq`)return jX(e,t,n,i,o);let c=t.schema.tags.find(e=>e.tag===o&&e.collection===s);if(!c){let r=t.schema.knownTags[o];if(r?.collection===s)t.schema.tags.push(Object.assign({},r,{default:!1})),c=r;else return r?i(a,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${s} collection, but expects ${r.collection??`scalar`}`,!0):i(a,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${o}`,!0),jX(e,t,n,i,o)}let l=jX(e,t,n,i,o,c),u=c.resolve?.(l,e=>i(a,`TAG_RESOLVE_FAILED`,e),t.options)??l,d=Xq(u)?u:new yJ(u);return d.range=l.range,d.tag=o,c?.format&&(d.format=c.format),d}function NX(e,t,n){let r=t.offset,i=PX(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?yJ.BLOCK_FOLDED:yJ.BLOCK_LITERAL,o=t.source?FX(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
||||
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
||||
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===bJ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||||
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===yJ.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
||||
`):t.length>c||r[0]===` `?(f===` `?f=`
|
||||
`:!p&&f===`
|
||||
`&&(f=`
|
||||
@@ -81,23 +81,23 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`+o[e][0].slice(c);d[d.length-1]!==`
|
||||
`&&(d+=`
|
||||
`);break;default:d+=`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function FX({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function IX(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function LX(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=bJ.PLAIN,c=RX(a,l);break;case`single-quoted-scalar`:s=bJ.QUOTE_SINGLE,c=zX(a,l);break;case`double-quoted-scalar`:s=bJ.QUOTE_DOUBLE,c=VX(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=OX(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function RX(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),BX(e)}function zX(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),BX(e.slice(1,-1)).replace(/''/g,`'`)}function BX(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function PX({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function FX(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r?.[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function IX(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=yJ.PLAIN,c=LX(a,l);break;case`single-quoted-scalar`:s=yJ.QUOTE_SINGLE,c=RX(a,l);break;case`double-quoted-scalar`:s=yJ.QUOTE_DOUBLE,c=BX(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=DX(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function LX(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),zX(e)}function RX(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),zX(e.slice(1,-1)).replace(/''/g,`'`)}function zX(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
||||
`?a+=o:o=`
|
||||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function VX(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
||||
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+(n?.[1]??``)}function BX(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
||||
`){if(i===`
|
||||
`){let{fold:t,offset:i}=HX(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=UX[i];if(a)n+=a;else if(i===`
|
||||
`){let{fold:t,offset:i}=VX(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=HX[i];if(a)n+=a;else if(i===`
|
||||
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
||||
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=WX(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
||||
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=UX(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
||||
`&&(a!==`\r`||e[r+2]!==`
|
||||
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function HX(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
||||
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function VX(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
||||
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
||||
`);)r===`
|
||||
`&&(n+=`
|
||||
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var UX={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function WX(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function GX(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?PX(e,t,r):LX(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Vq]:c?KX(e.schema,i,c,n,r):t.type===`scalar`?qX(e,i,t,r):e.schema[Vq];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=Jq(a)?a:new bJ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new bJ(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function KX(e,t,n,r,i){if(n===`!`)return e[Vq];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Vq])}function qX({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Vq];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Vq];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function JX(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var YX={composeNode:XX,composeEmptyNode:ZX};function XX(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=QX(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=GX(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=NX(YX,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=ZX(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!Jq(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function ZX(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=GX(e,{type:`scalar`,offset:JX(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function QX({options:e},{offset:t,source:n,end:r},i){let a=new _J(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=OX(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function $X(e,t,{offset:n,start:r,value:i,end:a},o){let s=new hX(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=xX(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?XX(c,i,l,o):ZX(c,l.end,r,null,l,o);let u=s.contents.range[2],d=OX(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function eZ(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function tZ(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
||||
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var HX={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function UX(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function WX(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?NX(e,t,r):IX(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Bq]:c?GX(e.schema,i,c,n,r):t.type===`scalar`?KX(e,i,t,r):e.schema[Bq];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=qq(a)?a:new yJ(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new yJ(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function GX(e,t,n,r,i){if(n===`!`)return e[Bq];let a=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)a.push(t);else return t}for(let e of a)if(e.test?.test(t))return e;let o=e.knownTags[n];return o&&!o.collection?(e.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Bq])}function KX({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>(t.default===!0||e&&t.default===`key`)&&t.test?.test(r))||n[Bq];if(n.compat){let e=n.compat.find(e=>e.default&&e.test?.test(r))??n[Bq];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function qX(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];n?.type===`space`;)e+=n.source.length,n=t[++r];break}}return e}var JX={composeNode:YX,composeEmptyNode:XX};function YX(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=ZX(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=WX(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=MX(JX,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=XX(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!qq(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function XX(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=WX(e,{type:`scalar`,offset:qX(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function ZX({options:e},{offset:t,source:n,end:r},i){let a=new gJ(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=DX(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function QX(e,t,{offset:n,start:r,value:i,end:a},o){let s=new mX(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=bX(r,{indicator:`doc-start`,next:i??a?.[0],offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?YX(c,i,l,o):XX(c,l.end,r,null,l,o);let u=s.contents.range[2],d=DX(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function $X(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function eZ(e){let t=``,n=!1,r=!1;for(let i=0;i<e.length;++i){let a=e[i];switch(a[0]){case`#`:t+=(t===``?``:r?`
|
||||
|
||||
`:`
|
||||
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var nZ=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=eZ(e);r?this.warnings.push(new yX(i,t,n)):this.errors.push(new vX(i,t,n))},this.directives=new lJ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=tZ(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Xq(i)&&!i.flow&&i.items.length>0){let e=i.items[0];qq(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=eZ(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=$X(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new vX(eZ(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new vX(eZ(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=OX(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new vX(eZ(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new hX(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},rZ=Symbol(`break visit`),iZ=Symbol(`skip children`),aZ=Symbol(`remove item`);function oZ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),sZ(Object.freeze([]),e,t)}oZ.BREAK=rZ,oZ.SKIP=iZ,oZ.REMOVE=aZ,oZ.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},oZ.parentCollection=(e,t)=>{let n=oZ.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function sZ(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=sZ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===rZ)return rZ;else r===aZ&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function Ite(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||||
`)+(a.substring(1)||` `),n=!0,r=!1;break;case`%`:e[i+1]?.[0]!==`#`&&(i+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var tZ=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=$X(e);r?this.warnings.push(new vX(i,t,n)):this.errors.push(new _X(i,t,n))},this.directives=new cJ({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=eZ(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Yq(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Kq(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:eZ(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=$X(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=QX(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new _X($X(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new _X($X(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=DX(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new _X($X(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new mX(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},nZ=Symbol(`break visit`),rZ=Symbol(`skip children`),iZ=Symbol(`remove item`);function aZ(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),oZ(Object.freeze([]),e,t)}aZ.BREAK=nZ,aZ.SKIP=rZ,aZ.REMOVE=iZ,aZ.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n?.[e];if(t&&`items`in t)n=t.items[r];else return}return n},aZ.parentCollection=(e,t)=>{let n=aZ.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n?.[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function oZ(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=oZ(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===nZ)return nZ;else r===iZ&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function sZ(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
||||
`:case`\r
|
||||
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function cZ(e){switch(e){case void 0:case` `:case`
|
||||
`:case`\r`:case` `:return!0;default:return!1}}var lZ=new Set(`0123456789ABCDEFabcdef`),uZ=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),dZ=new Set(`,[]{}`),fZ=new Set(` ,[]{}
|
||||
@@ -118,22 +118,22 @@ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\
|
||||
`,i=this.buffer[n+1]):t=n),i===`#`||e&&dZ.has(i))break;if(r===`
|
||||
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&dZ.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(pZ),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(cZ(n)||t&&dZ.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!cZ(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(uZ.has(t))t=this.buffer[++e];else if(t===`%`&&lZ.has(this.buffer[e+1])&&lZ.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
||||
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
||||
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},hZ=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function gZ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function _Z(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function vZ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function yZ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function bZ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function xZ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function SZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!gZ(t.start,`explicit-key-ind`)&&!gZ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,vZ(t.value)?t.value.end?xZ(t.value.end,t.sep):t.value.end=t.sep:xZ(t.start,t.sep),delete t.sep)}var CZ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new mZ,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=Ite(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&SZ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&_Z(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.
Line truncated
|
||||
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},hZ=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function gZ(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function _Z(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function vZ(e){switch(e?.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function yZ(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function bZ(e){if(e.length===0)return[];let t=e.length;loop:for(;--t>=0;)switch(e[t].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;e[++t]?.type===`space`;);return e.splice(t,e.length)}function xZ(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function SZ(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!gZ(t.start,`explicit-key-ind`)&&!gZ(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,vZ(t.value)?t.value.end?xZ(t.value.end,t.sep):t.value.end=t.sep:xZ(t.start,t.sep),delete t.sep)}var CZ=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new mZ,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=sZ(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&e?.type!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&SZ(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&_Z(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.i
Line truncated
|
||||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||||
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xZ(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(gZ(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=bZ(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(gZ(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(vZ(t.key)&&!gZ(t.sep,`newline`)){let e=bZ(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):gZ(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!gZ(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0;(Array.isArray(n)?n[n.length-1]:void 0)?.type===`comment`?n?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let n=e.items[e.items.length-2]?.value?.end;if(Array.isArray(n)){xZ(n,t.start),n.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||gZ(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while(e?.type===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.ite
Line truncated
|
||||
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
||||
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=bZ(yZ(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=bZ(yZ(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function wZ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new hZ||null,prettyErrors:t}}function TZ(e,t={}){let{lineCounter:n,prettyErrors:r}=wZ(t),i=new CZ(n?.addNewLine),a=new nZ(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new vX(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(bX(e,n)),o.warnings.forEach(bX(e,n))),o}function EZ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=TZ(e,n);if(!i)return null;if(i.warnings.forEach(e=>XJ(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function DZ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Gq(e)&&!r?e.toString(n):new hX(e,r,n).toString(n)}function OZ(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function kZ(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var AZ=140,jZ=280,MZ={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function NZ(e){return MZ[e]??e}var PZ=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function FZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function IZ(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function LZ(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
|
||||
`).find(e=>e.trim())?.trim()}}function RZ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(PZ)].map(e=>e[1]))]}function zZ(e){let t=TZ(e).toJS(),n=FZ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=FZ(e)?e:{},f=typeof u.type==`string`?u.type:``,p=FZ(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||NZ(f),type:f,detail:IZ(f,p),summary:LZ(p),when:typeof u.when==`string`?u.when:void 0,retry:FZ(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of RZ(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(FZ(t)&&FZ(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*jZ,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*AZ,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*AZ,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*AZ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var BZ={agent:$u,command:Bd,repo:hd,gate:Ld,forge:Cd,human:qd,review:pd,workflow:Xd},VZ={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function HZ(e){return BZ[e.split(`.`)[0]]??Xd}function UZ(e){return Object.keys(VZ).map(t=>({title:VZ[t],icon:BZ[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function WZ(e,t){let n=TZ(e).getIn(t,!0);if(Kq(n))return n.toJSON()}function GZ(e,t,n){let r=TZ(e);return r.setIn(t,r.createNode(ZZ(n))),r.toString()}function KZ(e,t,n){let r=TZ(e),i=r.get(`steps`,!0);if(Yq(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Yq(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function qZ(e,t){let n=TZ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Yq(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Kq(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function JZ(e,t){let n=TZ(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Yq(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function YZ(e,t,n){let r=TZ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Yq(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function XZ(e,t){let n=TZ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function ZZ(e){if(Array.isArray(e))return e.map(ZZ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=ZZ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function QZ(e,t){let n=TZ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():TZ(e).get(t)}function $Z(e,t,n){let r=TZ(e),i=ZZ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function eQ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function tQ(e,t=[]){let n=TZ(e),r=n.errors[0];if(r)return{ok:!1,message:hQ(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!gQ(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le
Line truncated
|
||||
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=bZ(yZ(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=bZ(yZ(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function wZ(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new hZ||null,prettyErrors:t}}function TZ(e,t={}){let{lineCounter:n,prettyErrors:r}=wZ(t),i=new CZ(n?.addNewLine),a=new tZ(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new _X(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(yX(e,n)),o.warnings.forEach(yX(e,n))),o}function EZ(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=TZ(e,n);if(!i)return null;if(i.warnings.forEach(e=>YJ(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}function DZ(e,t,n){let r=null;if(typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n==`string`&&(n=n.length),typeof n==`number`){let e=Math.round(n);n=e<1?void 0:e>8?{indent:8}:{indent:e}}if(e===void 0){let{keepUndefined:e}=n??t??{};if(!e)return}return Wq(e)&&!r?e.toString(n):new mX(e,r,n).toString(n)}function OZ(e,t){let n=new Map;for(let e of t)n.set(e.name,[...n.get(e.name)??[],e]);return{edges:e.edges,nodes:e.nodes.map(e=>{let{stage:t,occurrence:r}=e.data,i=t===void 0?void 0:n.get(t)?.[r??0];return i?{...e,data:{...e.data,run:i}}:e})}}function kZ(e,t){let n=e=>e.path&&e.path.length>=2?Number(e.path[1]):-1,r=e.nodes.find(e=>JSON.stringify(e.data.path)===JSON.stringify(t))?.data,i=r?.resume??r?.stage;if(!r||!i)return null;let a=Math.max(-1,...e.nodes.filter(e=>e.data.run).map(e=>n(e.data))),o=n(r);if(o<0||o>a)return null;let s=e.nodes.filter(e=>e.data.path?.length===2).sort((e,t)=>n(e.data)-n(t.data)).map(e=>e.data.resume??e.data.stage??``),c=e=>!!e&&s.filter(t=>t===e).length>1;return c(i)||o>0&&c(s[o-1])?{label:`Add an id to resume here`,from:i,blocked:!0}:{label:o===a?`Resume from here`:`Re-run from here`,from:i}}var AZ=140,jZ=280,MZ={"agent.run":`Agent`,"command.run":`Run commands`,"repo.prepare":`Prepare worktree`,"repo.commit":`Commit`,"repo.open-pr":`Open pull request`,"gate.repository":`Repository gate`,"gate.diff-size":`Diff size gate`,"gate.diff-rules":`Diff rules gate`,"forge.comment":`Comment`,"forge.close-issue":`Close issue`,"human.approve":`Human approval`,"workflow.call":`Call workflow`,"workflow.handoff":`Hand off`,"workflow.finish":`Finish`,"review.pr":`Review pull request`,"review.start-round":`Start review round`,"review.reply":`Reply to review`};function NZ(e){return MZ[e]??e}var PZ=/\{\{\s*steps\.([A-Za-z0-9_-]+)\.[^}]*\}\}/g;function FZ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function IZ(e,t){let n=e=>typeof t[e]==`string`?t[e]:``;switch(e){case`agent.run`:return[n(`role`)||`builder`,t.read_only?`read-only`:n(`gate`)?`gated: ${n(`gate`)}`:``].filter(Boolean).join(` · `);case`repo.commit`:return[n(`message`),t.push?`push`:``].filter(Boolean).join(` · `);case`workflow.call`:case`workflow.handoff`:return n(`workflow`);case`workflow.finish`:return n(`status`)||`completed`;case`human.approve`:return n(`then`)?`then ${n(`then`)}`:``;case`gate.repository`:return n(`expect`)===`test-failure`?`tests must fail`:t.repair?`repair if red`:``}return``}function LZ(e){for(let t of[`mission`,`message`,`body`,`plan`,`detail`]){let n=e[t];if(typeof n==`string`&&n.trim())return n.replace(/\{\{\s*([^}]+?)\s*\}\}/g,`‹$1›`).split(`
|
||||
`).find(e=>e.trim())?.trim()}}function RZ(e,t){let n=JSON.stringify(e??{})+` `+(typeof t==`string`?`{{ ${t.replace(/^!/,``)} }}`:``);return[...new Set([...n.matchAll(PZ)].map(e=>e[1]))]}function zZ(e){let t=TZ(e).toJS(),n=FZ(t)&&Array.isArray(t.steps)?t.steps:[],r=[],i=[],a=new Map,o=[],s=`start`;r.push({id:s,type:`step`,position:{x:0,y:0},data:{kind:`start`,key:`start`,title:`Starts when`,type:``,detail:``}});let c=[s],l=1,u=new Map,d=e=>{let t=u.get(e)??0;return u.set(e,t+1),t},f=(e,t,n,i,s,c,l)=>{let u=FZ(e)?e:{},f=typeof u.type==`string`?u.type:``,p=FZ(u.settings)?u.settings:{},m=typeof u.id==`string`?u.id:``,h=`step-${t}`,g=s?`${s}/${m||f}`:m||f;r.push({id:h,type:`step`,position:{x:n,y:i},data:{kind:`step`,key:m||t,title:m||NZ(f),type:f,detail:IZ(f,p),summary:LZ(p),when:typeof u.when==`string`?u.when:void 0,retry:FZ(u.retry)&&typeof u.retry.attempts==`number`?u.retry.attempts:void 0,continues:u.on_failure===`continue`,branch:s,path:l,stage:g,occurrence:d(g),...c?{resume:c}:{}}}),m&&a.set(m,h);for(let e of RZ(u.settings,u.when))o.push({from:e,to:h});return h},p=(e,t,n)=>{e.forEach((r,a)=>i.push({id:`flow-${r}-${t}`,source:r,target:t,kind:`flow`,insertAfter:a===e.length-1?n:void 0}))};for(let[e,t]of n.entries()){if(FZ(t)&&FZ(t.parallel)){let n=Object.entries(t.parallel),r=typeof t.id==`string`?t.id:`parallel`,i=[],a=0;n.forEach(([t,o],s)=>{let u=(s-(n.length-1)/2)*jZ,d=c,m=c;(Array.isArray(o)?o:[]).forEach((i,o)=>{let c=f(i,`${e+1}-${t}-${o+1}`,u,(l+o)*AZ,t,r,[`steps`,e,`parallel`,t,o]);p(d,c,d===m&&s===n.length-1?e-1:void 0),d=[c],a=Math.max(a,o+1)}),i.push(...d)}),c=i,l+=Math.max(a,1);continue}let n=f(t,String(e+1),0,l*AZ,void 0,void 0,[`steps`,e]);p(c,n,e-1),c=[n],l++}r.push({id:`add-end`,type:`add`,position:{x:104,y:l*AZ-24},data:{kind:`step`,key:`add`,title:``,type:``,detail:``}}),p(c,`add-end`);for(let{from:e,to:t}of o){let n=a.get(e);n&&(i.some(e=>e.kind===`flow`&&e.source===n&&e.target===t)||i.push({id:`data-${n}-${t}`,source:n,target:t,kind:`data`,label:e,offset:24+14*i.filter(e=>e.kind===`data`).length,sourceHandle:`data-out`,targetHandle:`data-in`}))}return{nodes:r,edges:i}}var BZ={agent:Qu,command:zd,repo:md,gate:Id,forge:Sd,human:Kd,review:fd,workflow:Yd},VZ={agent:`Agents`,command:`Commands`,repo:`Repository`,gate:`Checks`,forge:`Issues and PRs`,human:`People`,review:`Review`,workflow:`Flow`};function HZ(e){return BZ[e.split(`.`)[0]]??Yd}function UZ(e){return Object.keys(VZ).map(t=>({title:VZ[t],icon:BZ[t],types:e.filter(e=>e.split(`.`)[0]===t)})).filter(e=>e.types.length)}function WZ(e,t){let n=TZ(e).getIn(t,!0);if(Gq(n))return n.toJSON()}function GZ(e,t,n){let r=TZ(e);return r.setIn(t,r.createNode(ZZ(n))),r.toString()}function KZ(e,t,n){let r=TZ(e),i=r.get(`steps`,!0);if(Jq(i)||(r.set(`steps`,r.createNode([])),i=r.get(`steps`,!0)),!Jq(i))return{source:e,path:[]};let a=Math.min(Math.max(t+1,0),i.items.length);return i.items.splice(a,0,r.createNode({type:n})),{source:r.toString(),path:[`steps`,a]}}function qZ(e,t){let n=TZ(e),r=n.getIn(t.slice(0,-1),!0),i=t.at(-1);if(!Jq(r)||typeof i!=`number`)return{source:e,path:t};let a=n.createNode(n.getIn(t));return Gq(a)&&a.delete(`id`),r.items.splice(i+1,0,a),{source:n.toString(),path:[...t.slice(0,-1),i+1]}}function JZ(e,t){let n=TZ(e);n.deleteIn(t);let r=t.slice(0,-1);if(r.length>2){let e=n.getIn(r,!0);Jq(e)&&e.items.length===0&&n.deleteIn(r)}return n.toString()}function YZ(e,t,n){let r=TZ(e),i=r.getIn(t.slice(0,-1),!0),a=t.at(-1);if(!Jq(i)||typeof a!=`number`)return{source:e,path:t};let o=a+n;if(o<0||o>=i.items.length)return{source:e,path:t};let[s]=i.items.splice(a,1);return i.items.splice(o,0,s),{source:r.toString(),path:[...t.slice(0,-1),o]}}function XZ(e,t){let n=TZ(e).toJS(),r=Array.isArray(n?.steps)?n.steps:[],i=typeof t[1]==`number`?t[1]:r.length,a=[],o=e=>{if(typeof e!=`object`||!e)return;let t=e;if(typeof t.id==`string`&&a.push(t.id),typeof t.parallel==`object`&&t.parallel!==null)for(let e of Object.values(t.parallel))Array.isArray(e)&&e.forEach(o)};if(r.slice(0,i).forEach(o),t.length===5){let e=r[i]?.parallel?.[t[3]];Array.isArray(e)&&e.slice(0,t[4]).forEach(o)}return a}function ZZ(e){if(Array.isArray(e))return e.map(ZZ);if(typeof e!=`object`||!e)return e;let t={};for(let[n,r]of Object.entries(e)){if(r===void 0||r===``||r===null)continue;let e=ZZ(r);(typeof e!=`object`||!e||Array.isArray(e)||Object.keys(e).length!==0)&&(t[n]=e)}return t}function QZ(e,t){let n=TZ(e).get(t,!0);return n&&typeof n==`object`&&`toJSON`in n?n.toJSON():TZ(e).get(t)}function $Z(e,t,n){let r=TZ(e),i=ZZ({[t]:n})[t];return i===void 0?r.delete(t):r.set(t,r.createNode(i)),r.toString()}function eQ(e){return e.ok?`Valid`:e.line?`Line ${e.line}: ${e.message}`:e.message}function tQ(e,t=[]){let n=TZ(e),r=n.errors[0];if(r)return{ok:!1,message:hQ(r.message),line:r.linePos?.[0]?.line};let i=n.toJS();if(!gQ(i))return{ok:!1,message:`A workflow is a mapping with an id and steps.`};let a=typeof i.id==`string`?i.id.trim():``;if(!a)return{ok:!1,message:`workflow id is required`};le
Line truncated
|
||||
`).map((e,t)=>({number:t+1,text:e,tokens:dQ(e)}))}var lQ=/^(\s*)(-\s+)?/,uQ=/^([^:#\s][^:#]*?)(:)(\s*)(.*)$/;function dQ(e){let{code:t,comment:n}=fQ(e),r=pQ(t);return n&&r.push({text:n,kind:`comment`}),r}function fQ(e){let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(t){r===t&&(t=``);continue}if(r===`"`||r===`'`){t=r;continue}if(r===`#`&&(n===0||/\s/.test(e[n-1]??``)))return{code:e.slice(0,n),comment:e.slice(n)}}return{code:e,comment:``}}function pQ(e){if(!e)return[];let t=[],n=lQ.exec(e);n?.[1]&&t.push({text:n[1],kind:`plain`}),n?.[2]&&t.push({text:n[2],kind:`punct`});let r=e.slice(n?.[0].length??0);if(!r)return t;let i=uQ.exec(r);return i?(t.push({text:i[1]??``,kind:`key`}),t.push({text:i[2]??`:`,kind:`punct`}),i[3]&&t.push({text:i[3],kind:`plain`}),[...t,...mQ(i[4]??``)]):[...t,...mQ(r)]}function mQ(e){if(!e)return[];let t=/^("[^"]*"?|'[^']*'?)([\s\S]*)$/.exec(e);if(!t)return[{text:e,kind:`plain`}];let n=[{text:t[1]??``,kind:`string`}];return t[2]&&n.push({text:t[2],kind:`plain`}),n}function hQ(e){return e.split(`
|
||||
`)[0]?.trim()||`invalid YAML`}function gQ(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function _Q(e){return typeof e==`string`&&e.trim()!==``}var vQ={class:`flex h-full w-[24rem] flex-col border-l border-border bg-card shadow-xl`},yQ={class:`flex items-center gap-2.5 border-b border-border px-4 py-3`},bQ={class:`flex size-8 shrink-0 items-center justify-center rounded-md bg-secondary text-primary`},xQ={class:`min-w-0 flex-1`},SQ=[`value`,`placeholder`],CQ={class:`truncate font-mono text-[11px] text-fg-subtle`},wQ={class:`flex-1 space-y-5 overflow-y-auto px-4 py-4`},TQ={key:0,class:`rounded-md bg-danger/10 px-2.5 py-1.5 text-xs text-danger`,role:`alert`},EQ={key:1,class:`space-y-1.5`},DQ=[`title`],OQ=[`value`],kQ=[`value`],AQ={key:3,class:`flex flex-wrap items-center gap-1 pt-0.5`},jQ=[`onClick`],MQ=[`onClick`],NQ={key:2,class:`divide-y divide-border rounded-md border border-border`},PQ=[`title`],FQ=[`value`,`onChange`],IQ=[`value`],LQ=[`value`,`onInput`],RQ=[`value`,`onFocus`,`onInput`],zQ=[`title`],BQ={key:0,class:`text-xs text-danger`},VQ={class:`space-y-2`},HQ={class:`divide-y divide-border rounded-md border border-border`},UQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},WQ=[`value`],GQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},KQ=[`value`],qQ={class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},JQ=[`value`],YQ={class:`flex items-center border-t border-border px-4 py-2.5`},XQ=L({__name:`StepEditor`,props:{yaml:{},path:{},vocabulary:{}},emits:[`update:yaml`,`close`,`remove`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>WZ(n.yaml,n.path)??{}),a=Y(()=>typeof i.value.type==`string`?i.value.type:``),o=Y(()=>n.vocabulary.find(e=>e.name===a.value)),s=Y(()=>typeof i.value.settings==`object`&&i.value.settings!==null?i.value.settings:{}),c=Y(()=>XZ(n.yaml,n.path)),l=Y(()=>o.value?.settings&&i.value.settings?oQ(i.value.settings,o.value.settings,`settings`):``),u=[`mission`,`workflow`,`message`,`body`,`plan`,`then`,`status`,`detail`,`run`,`rules`],d=/mission|body|detail|plan|rules/;function f(e,t){return t.type===`string`?t.enum?`select`:d.test(e)?`text`:`line`:t.type===`boolean`?`boolean`:t.type===`integer`||t.type===`number`?`number`:t.type===`array`&&t.items?.type===`string`?`lines`:`yaml`}let p=Y(()=>{let e=Object.entries(o.value?.settings?.properties??{}).map(([e,t])=>({key:e,schema:t,kind:f(e,t)})),t=e.filter(e=>u.includes(e.key)&&e.kind!==`boolean`).sort((e,t)=>u.indexOf(e.key)-u.indexOf(t.key))[0],n=e.filter(e=>e!==t);return{lead:t,compact:n.filter(e=>[`select`,`line`,`number`,`boolean`].includes(e.kind)),long:n.filter(e=>[`text`,`lines`,`yaml`].includes(e.kind))}});function m(e){let{id:t,type:i,...a}=e;r(`update:yaml`,GZ(n.yaml,n.path,{id:t,type:i,...a}))}function h(e,t){m({...i.value,[e]:t})}function g(e,t){m({...i.value,settings:{...s.value,[e]:t}})}let _=N(null);function v(e,t){let n=_.value??p.value.lead?.key;if(!n)return;let r=typeof s.value[n]==`string`?s.value[n]:``,i=`{{ steps.${e}.${t} }}`;g(n,r?`${r.trimEnd()} ${i}`:i)}let y=N({});function b(e,t){try{g(e,t.trim()?EZ(t):void 0),y.value={...y.value,[e]:``}}catch(t){y.value={...y.value,[e]:String(t.message).split(`
|
||||
`)[0]}}}let x=e=>e===void 0?``:DZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,vQ,[W(`header`,yQ,[W(`span`,bQ,[(V(),U(ta(P(HZ)(a.value)),{class:`size-4`}))]),W(`div`,xQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(NZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,SQ),W(`div`,CQ,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Qd))]),_:1})]),W(`div`,wQ,[l.value?(V(),H(`p`,TQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,EQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,DQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,kQ))),128))],40,OQ)):p.value.lead.kind===`text`?(V(),U(P(lT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(SO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,AQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,jQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,MQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,NQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,PQ),e.kind===`boolean`?(V(),U(P(qO),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,IQ))),128))],40,FQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,LQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,RQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(ld),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,zQ),e.kind===`text`?(V(),U(P(lT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(lT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
|
||||
`)[0]}}}let x=e=>e===void 0?``:DZ(e).trimEnd(),S=(e,t)=>t.title??e.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase()),C=e=>typeof s.value[e]==`string`?s.value[e]:``;return(e,t)=>(V(),H(`aside`,vQ,[W(`header`,yQ,[W(`span`,bQ,[(V(),U(ea(P(HZ)(a.value)),{class:`size-4`}))]),W(`div`,xQ,[W(`input`,{value:i.value.id??``,class:`w-full truncate bg-transparent text-sm font-medium outline-none placeholder:text-fg-subtle focus:underline`,placeholder:P(NZ)(a.value),"aria-label":`Step id`,onInput:t[0]||=e=>h(`id`,e.target.value)},null,40,SQ),W(`div`,CQ,M(a.value),1)]),G(P($),{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Close`,onClick:t[1]||=e=>r(`close`)},{default:F(()=>[G(P(Zd))]),_:1})]),W(`div`,wQ,[l.value?(V(),H(`p`,TQ,M(l.value),1)):q(``,!0),p.value.lead?(V(),H(`section`,EQ,[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:p.value.lead.schema.description},[K(M(S(p.value.lead.key,p.value.lead.schema))+` `,1),p.value.lead.schema.description?(V(),U(P(cd),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,DQ),p.value.lead.kind===`select`?(V(),H(`select`,{key:0,class:`h-9 w-full rounded-md border border-input bg-background px-2`,value:C(p.value.lead.key),onChange:t[2]||=e=>g(p.value.lead.key,e.target.value||void 0)},[t[12]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(p.value.lead.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,kQ))),128))],40,OQ)):p.value.lead.kind===`text`?(V(),U(P(cT),{key:1,"model-value":C(p.value.lead.key),class:`min-h-40 text-[13px] leading-relaxed`,onFocus:t[3]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[4]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])):(V(),U(P(bO),{key:2,"model-value":C(p.value.lead.key),onFocus:t[5]||=e=>_.value=p.value.lead.key,"onUpdate:modelValue":t[6]||=e=>g(p.value.lead.key,String(e))},null,8,[`model-value`])),c.value.length&&p.value.lead.kind!==`select`?(V(),H(`div`,AQ,[t[13]||=W(`span`,{class:`text-[11px] text-fg-subtle`},`Insert`,-1),(V(!0),H(B,null,R(c.value,e=>(V(),H(B,{key:e},[W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`summary`)},M(e),9,jQ),W(`button`,{type:`button`,class:`rounded-full border border-border px-2 py-0.5 font-mono text-[11px] hover:border-primary hover:text-primary`,onClick:t=>v(e,`result`)},M(e)+`.result`,9,MQ)],64))),128))])):q(``,!0)])):q(``,!0),p.value.compact.length?(V(),H(`section`,NQ,[(V(!0),H(B,null,R(p.value.compact,e=>(V(),H(`div`,{key:e.key,class:`flex min-h-10 items-center gap-3 px-3 py-1.5`},[W(`span`,{class:`flex flex-1 items-center gap-1 text-[13px]`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(cd),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,PQ),e.kind===`boolean`?(V(),U(P(GO),{key:0,"model-value":s.value[e.key]===!0,"onUpdate:modelValue":t=>g(e.key,t||void 0)},null,8,[`model-value`,`onUpdate:modelValue`])):e.kind===`select`?(V(),H(`select`,{key:1,class:`h-7 max-w-40 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:C(e.key),onChange:t=>g(e.key,t.target.value||void 0)},[t[14]||=W(`option`,{value:``},`Default`,-1),(V(!0),H(B,null,R(e.schema.enum,e=>(V(),H(`option`,{key:e,value:e},M(e),9,IQ))),128))],40,FQ)):e.kind===`number`?(V(),H(`input`,{key:2,type:`number`,class:`h-7 w-24 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:s.value[e.key]??``,onInput:t=>g(e.key,t.target.value===``?void 0:Number(t.target.value))},null,40,LQ)):(V(),H(`input`,{key:3,class:`h-7 w-40 rounded-md border border-input bg-background px-2 text-[13px]`,value:C(e.key),onFocus:t=>_.value=e.key,onInput:t=>g(e.key,t.target.value)},null,40,RQ))]))),128))])):q(``,!0),(V(!0),H(B,null,R(p.value.long,e=>(V(),H(`section`,{key:e.key,class:`space-y-1.5`},[W(`div`,{class:`flex items-center gap-1 text-xs font-medium text-muted-foreground`,title:e.schema.description},[K(M(S(e.key,e.schema))+` `,1),e.schema.description?(V(),U(P(cd),{key:0,class:`size-3 text-fg-subtle`})):q(``,!0)],8,zQ),e.kind===`text`?(V(),U(P(cT),{key:0,"model-value":C(e.key),class:`min-h-20 text-[13px]`,onFocus:t=>_.value=e.key,"onUpdate:modelValue":t=>g(e.key,String(t))},null,8,[`model-value`,`onFocus`,`onUpdate:modelValue`])):e.kind===`lines`?(V(),U(P(cT),{key:1,"model-value":Array.isArray(s.value[e.key])?s.value[e.key].join(`
|
||||
`):``,class:`min-h-16 font-mono text-xs`,placeholder:`One per line`,"onUpdate:modelValue":t=>g(e.key,String(t).split(`
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(lT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,BQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,VQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,HQ,[W(`label`,UQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,WQ)]),W(`label`,GQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,KQ)]),W(`label`,qQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,JQ)])])])]),W(`footer`,YQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Hd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),ZQ=`repository_path`;function QQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:ZQ,path:n.trim(),type:`string`,required:!0}),r}function $Q(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function e$(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=$Q(EP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function t$(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:EP(e.value,i.type??`string`)})}return n}function n$(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function r$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...r$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...r$(n,r)]}):[]}function i$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function a$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function o$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var s$={class:`flex h-full flex-col`},c$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},l$={class:`min-w-0 flex-1 truncate text-sm font-medium`},u$={key:0,class:`flex flex-1 items-center justify-center`},d$={class:`space-y-1.5`},f$=[`disabled`],p$=[`value`],m$={key:1,class:`space-y-1.5`},h$=[`value`],g$=[`title`],_$={class:`space-y-1.5`},v$={id:`bind-paths`},y$=[`value`],b$={class:`divide-y divide-border rounded-md border border-border`},x$={class:`flex items-center gap-1.5 text-xs`},S$={class:`font-mono`},C$={class:`text-fg-subtle`},w$={key:0,class:`text-danger`,title:`Required`},T$=[`title`,`aria-label`,`onClick`],E$=[`onUpdate:modelValue`,`aria-label`],D$=[`onUpdate:modelValue`,`aria-label`],O$={key:2,class:`text-xs text-danger`},k$=[`title`],A$={key:0,class:`space-y-1 px-3 py-2`},j$={key:0,class:`text-xs text-danger`},M$={key:1,class:`truncate font-mono text-xs text-success`},N$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},P$={class:`space-y-2`},F$={key:0,role:`alert`,class:`text-xs text-danger`},I$={key:1,class:`text-xs text-fg-subtle`},L$={class:`flex gap-2`},R$=`__new__`,z$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(QZ(n.yaml,`id`)??``)),a=Y(()=
Line truncated
|
||||
`).filter(Boolean))},null,8,[`model-value`,`onUpdate:modelValue`])):(V(),H(B,{key:2},[G(P(cT),{"model-value":x(s.value[e.key]),class:`min-h-24 font-mono text-xs`,placeholder:`YAML`,onChange:t=>b(e.key,t.target.value)},null,8,[`model-value`,`onChange`]),y.value[e.key]?(V(),H(`span`,BQ,M(y.value[e.key]),1)):q(``,!0)],64))]))),128)),W(`section`,VQ,[t[19]||=W(`div`,{class:`text-xs font-medium text-muted-foreground`},`Flow`,-1),W(`div`,HQ,[W(`label`,UQ,[t[15]||=W(`span`,{class:`flex-1 text-[13px]`},`Run only when`,-1),W(`input`,{class:`h-7 w-48 rounded-md border border-input bg-background px-2 font-mono text-xs`,placeholder:`always`,value:i.value.when??``,onInput:t[7]||=e=>h(`when`,e.target.value)},null,40,WQ)]),W(`label`,GQ,[t[17]||=W(`span`,{class:`flex-1 text-[13px]`},`If it fails`,-1),W(`select`,{class:`h-7 rounded-md border border-input bg-background px-1.5 text-[13px]`,value:i.value.on_failure??``,onChange:t[8]||=e=>h(`on_failure`,e.target.value||void 0)},[...t[16]||=[W(`option`,{value:``},`Park the task`,-1),W(`option`,{value:`continue`},`Continue`,-1)]],40,KQ)]),W(`label`,qQ,[t[18]||=W(`span`,{class:`flex-1 text-[13px]`},`Attempts`,-1),W(`input`,{type:`number`,min:`1`,max:`10`,placeholder:`1`,class:`h-7 w-20 rounded-md border border-input bg-background px-2 text-right text-[13px]`,value:i.value.retry?.attempts??``,onInput:t[9]||=e=>h(`retry`,e.target.value===``?void 0:{...i.value.retry,attempts:Number(e.target.value)})},null,40,JQ)])])])]),W(`footer`,YQ,[G(P($),{type:`button`,variant:`ghost`,size:`sm`,class:`text-danger`,onClick:t[10]||=e=>r(`remove`)},{default:F(()=>[G(P(Vd)),t[20]||=K(` Delete step`,-1)]),_:1}),G(P($),{type:`button`,size:`sm`,class:`ml-auto`,onClick:t[11]||=e=>r(`close`)},{default:F(()=>[...t[21]||=[K(`Done`,-1)]]),_:1})])]))}}),ZQ=`repository_path`;function QQ(e,t,n){let r=[];for(let[n,i]of e){let e=t[n];e?.from===`path`&&e.path.trim()&&r.push({name:n,path:e.path.trim(),type:i.type??`string`,required:i.required===!0})}return n.trim()&&r.push({name:ZQ,path:n.trim(),type:`string`,required:!0}),r}function $Q(e){return Array.isArray(e)?`array`:e===null?`null`:typeof e==`boolean`?`bool`:typeof e==`object`?`object`:typeof e}function e$(e,t,n){let r=[];for(let[i,a]of e){let e=t[i],o=a.type??`string`;if(!(e&&(e.from===`path`?e.path.trim():e.value!==``))){a.required&&r.push(`${i} is required`);continue}if(e.from===`path`){let e=n?.failures?.find(e=>e.field_name===i);e&&r.push(`${i}: ${e.reason}`);continue}let s=$Q(wP(e.value,o));o!==`any`&&s!==o&&r.push(`${i} is ${o}, but ${JSON.stringify(e.value)} is not`)}return n?.failures?.some(e=>e.field_name===`repository_path`)&&r.push(`the repository path does not resolve`),r}function t$(e,t){let n={};for(let[r,i]of e){let e=t[r];e?.from===`path`&&e.path.trim()?n[r]={param:r}:e?.from===`value`&&e.value!==``&&(n[r]={value:wP(e.value,i.type??`string`)})}return n}function n$(e,t){let n=e=>t.find(t=>t.name===e)?.path??``,r={};for(let[t,i]of Object.entries(e.inputs??{}))r[t]=i.param?{from:`path`,path:n(i.param),value:``}:{from:`value`,path:``,value:typeof i.value==`string`?i.value:JSON.stringify(i.value)};return{rows:r,repositoryPath:n(e.repo_param)}}function r$(e,t=``){return Array.isArray(e)?e.slice(0,3).flatMap((e,n)=>{let r=`${t}[${n}]`;return[r,...r$(e,r)]}):e&&typeof e==`object`?Object.entries(e).flatMap(([e,n])=>{let r=t?`${t}.${e}`:e;return[r,...r$(n,r)]}):[]}function i$(e){try{return e?.body?JSON.parse(e.body):null}catch{return null}}function a$(e){try{let t=JSON.parse(e.headers??`{}`);return Object.fromEntries(Object.entries(t).map(([e,t])=>[e,Array.isArray(t)?t.join(`, `):String(t)]))}catch{return{}}}function o$(e){let t=typeof e==`string`?e:JSON.stringify(e);return t.length>80?`${t.slice(0,80)}…`:t}var s$={class:`flex h-full flex-col`},c$={class:`flex items-center gap-2 border-b border-border px-4 py-3`},l$={class:`min-w-0 flex-1 truncate text-sm font-medium`},u$={key:0,class:`flex flex-1 items-center justify-center`},d$={class:`space-y-1.5`},f$=[`disabled`],p$=[`value`],m$={key:1,class:`space-y-1.5`},h$=[`value`],g$=[`title`],_$={class:`space-y-1.5`},v$={id:`bind-paths`},y$=[`value`],b$={class:`divide-y divide-border rounded-md border border-border`},x$={class:`flex items-center gap-1.5 text-xs`},S$={class:`font-mono`},C$={class:`text-fg-subtle`},w$={key:0,class:`text-danger`,title:`Required`},T$=[`title`,`aria-label`,`onClick`],E$=[`onUpdate:modelValue`,`aria-label`],D$=[`onUpdate:modelValue`,`aria-label`],O$={key:2,class:`text-xs text-danger`},k$=[`title`],A$={key:0,class:`space-y-1 px-3 py-2`},j$={key:0,class:`text-xs text-danger`},M$={key:1,class:`truncate font-mono text-xs text-success`},N$={key:1,class:`px-3 py-2 text-xs text-fg-subtle`},P$={class:`space-y-2`},F$={key:0,role:`alert`,class:`text-xs text-danger`},I$={key:1,class:`text-xs text-fg-subtle`},L$={class:`flex gap-2`},R$=`__new__`,z$=L({__name:`BindEvent`,props:{yaml:{},binding:{}},emits:[`back`,`saved`],setup(e,{emit:t}){let n=e,r=t,i=Y(()=>String(QZ(n.yaml,`id`)??``)),a=Y(()=
Line truncated
|
||||
`).replace(`
|
||||
|
||||
`,`
|
||||
+`).split(`
|
||||
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function w5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=T5(n.code,e);return Array.isArray(e)?e.some(e=>C5(n[r],e,t,n.type===`keyup`)):C5(n[r],e,t,n.type===`keyup`)}}function T5(e,t){return t.includes(e)?`code`:`key`}function E5(e,t){let n=Y(()=>pn(t?.target)??b5),r=ln(pn(e)===!0),i=!1,a=new Set,o=c(pn(e));I(()=>pn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),v0([`blur`,`contextmenu`],s),b0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0,a=pn(t?.preventDefault)??!1;if(i=S5(e),(!i||i&&!n)&&x5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),b0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&x5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=pn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?w5(e,a):e}return r}var D5=`vue-flow__node-desc`,O5=`vue-flow__edge-desc`,k5=`vue-flow__aria-live`,A5=[`Enter`,` `,`Escape`],j5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function M5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function N5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function P5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function F5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function I5(e,t){return{x:F5(e.x,t[0][0],t[1][0]),y:F5(e.y,t[0][1],t[1][1])}}function L5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function R5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function z5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!R5(e)}function B5(e){return z5(e)&&`computedPosition`in e}function V5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function H5(e){return V5(e.width)&&V5(e.height)&&V5(e.x)&&V5(e.y)}function U5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:an({width:0,height:0}),computedPosition:an({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function W5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function G5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function K5(...e){if(e.length===3){let[t,n,r]=e;return G5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>R5(e)&&e.source===r).map(e=>n.find(t=>z5(t)&&t.id===e.target))}function q5(...e){if(e.length===3){let[t,n,r]=e;return G5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>R5(e)&&e.target===r).map(e=>n.find(t=>z5(t)&&t.id===e.source))}function J5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Y5(e,t){return t.some(t=>R5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function X5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function Z5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function Q5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function $5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function e7({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function t7(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=Q5(t,$5({...r.computedPosition,...r.dimensions}))}return e7(t)}function n7(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...Z5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=
Line truncated
|
||||
`).map(e=>e.trim().toLowerCase());if(i.length===1)return e.toLowerCase()===t.toLowerCase();r||n.add(e.toLowerCase());let a=i.every((e,t)=>n.has(e)&&Array.from(n.values())[t]===i[t]);return r&&n.delete(e.toLowerCase()),a}function w5(e,t){return n=>{if(!n.code&&!n.key)return!1;let r=T5(n.code,e);return Array.isArray(e)?e.some(e=>C5(n[r],e,t,n.type===`keyup`)):C5(n[r],e,t,n.type===`keyup`)}}function T5(e,t){return t.includes(e)?`code`:`key`}function E5(e,t){let n=Y(()=>pn(t?.target)??b5),r=ln(pn(e)===!0),i=!1,a=new Set,o=c(pn(e));I(()=>pn(e),(e,t)=>{typeof t==`boolean`&&typeof e!=`boolean`&&s(),o=c(e)},{immediate:!0}),v0([`blur`,`contextmenu`],s),b0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0,a=pn(t?.preventDefault)??!1;if(i=S5(e),(!i||i&&!n)&&x5(e))return;let o=e.composedPath?.call(e)?.[0]||e.target,s=o?.nodeName===`BUTTON`||o?.nodeName===`A`;!a&&(i||!s)&&e.preventDefault(),r.value=!0},{eventName:`keydown`,target:n}),b0((...e)=>o(...e),e=>{let n=pn(t?.actInsideInputWithModifier)??!0;if(r.value){if((!i||i&&!n)&&x5(e))return;i=!1,r.value=!1}},{eventName:`keyup`,target:n});function s(){i=!1,a.clear(),r.value=pn(e)===!0}function c(e){return e===null?(s(),()=>!1):typeof e==`boolean`?(s(),r.value=e,()=>!1):Array.isArray(e)||typeof e==`string`?w5(e,a):e}return r}var D5=`vue-flow__node-desc`,O5=`vue-flow__edge-desc`,k5=`vue-flow__aria-live`,A5=[`Enter`,` `,`Escape`],j5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function M5(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function N5(e,t){let n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)}function P5(e){return{width:e.offsetWidth,height:e.offsetHeight}}function F5(e,t=0,n=1){return Math.min(Math.max(e,t),n)}function I5(e,t){return{x:F5(e.x,t[0][0],t[1][0]),y:F5(e.y,t[0][1],t[1][1])}}function L5(e){let t=e.getRootNode();return`elementFromPoint`in t?t:window.document}function R5(e){return e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e}function z5(e){return e&&typeof e==`object`&&`id`in e&&`position`in e&&!R5(e)}function B5(e){return z5(e)&&`computedPosition`in e}function V5(e){return!Number.isNaN(e)&&Number.isFinite(e)}function H5(e){return V5(e.width)&&V5(e.height)&&V5(e.x)&&V5(e.y)}function U5(e,t,n){let r={id:e.id.toString(),type:e.type??`default`,dimensions:an({width:0,height:0}),computedPosition:an({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{})};return Object.assign(t??r,e,{id:e.id.toString(),parentNode:n})}function W5(e,t,n){let r={id:e.id.toString(),type:e.type??t?.type??`default`,source:e.source.toString(),target:e.target.toString(),sourceHandle:e.sourceHandle?.toString(),targetHandle:e.targetHandle?.toString(),updatable:e.updatable??n?.updatable,selectable:e.selectable??n?.selectable,focusable:e.focusable??n?.focusable,data:G7(e.data)?e.data:{},events:an(G7(e.events)?e.events:{}),label:e.label??``,interactionWidth:e.interactionWidth??n?.interactionWidth,...n??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function G5(e,t,n,r){let i=typeof e==`string`?e:e.id,a=new Set,o=r===`source`?`target`:`source`;for(let e of n)e[o]===i&&a.add(e[r]);return t.filter(e=>a.has(e.id))}function K5(...e){if(e.length===3){let[t,n,r]=e;return G5(t,n,r,`target`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>R5(e)&&e.source===r).map(e=>n.find(t=>z5(t)&&t.id===e.target))}function q5(...e){if(e.length===3){let[t,n,r]=e;return G5(t,n,r,`source`)}let[t,n]=e,r=typeof t==`string`?t:t.id;return n.filter(e=>R5(e)&&e.target===r).map(e=>n.find(t=>z5(t)&&t.id===e.source))}function J5({source:e,sourceHandle:t,target:n,targetHandle:r}){return`vueflow__edge-${e}${t??``}-${n}${r??``}`}function Y5(e,t){return t.some(t=>R5(t)&&t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle))}function X5({x:e,y:t},{x:n,y:r,zoom:i}){return{x:e*i+n,y:t*i+r}}function Z5({x:e,y:t},{x:n,y:r,zoom:i},a=!1,o=[1,1]){let s={x:(e-n)/i,y:(t-r)/i};return a?F7(s,o):s}function Q5(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function $5({x:e,y:t,width:n,height:r}){return{x:e,y:t,x2:e+n,y2:t+r}}function e7({x:e,y:t,x2:n,y2:r}){return{x:e,y:t,width:n-e,height:r-t}}function t7(e){let t={x:1/0,y:1/0,x2:-1/0,y2:-1/0};for(let n=0;n<e.length;n++){let r=e[n];t=Q5(t,$5({...r.computedPosition,...r.dimensions}))}return e7(t)}function n7(e,t,n={x:0,y:0,zoom:1},r=!1,i=!1){let a={...Z5(t,n),width:t.width/n.zoom,height:t.height/n.zoom},o=[];for(let t of e){let{dimensions:e,selectable:n=!0,hidden:s=
Line truncated
|
||||
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
||||
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
||||
Node: ${e}
|
||||
@@ -153,4 +153,4 @@ Edge: ${e}
|
||||
Source: ${t}
|
||||
Target: ${n}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
||||
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
||||
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},j7=class extends Error{constructor(e,...t){super(A7[e]?.call(A7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function M7(e){return`clientX`in e}function Ute(e){return`sourceEvent`in e}function N7(e,t){let n=M7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Wte(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Gte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function Kte(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())N5(i,M5(e))>0&&r.push(e);return r}var qte=250;function Jte(e,t,n,r){let i=[],a=1/0,o=Kte(e,n,t+qte);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=D7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Gte},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=N7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=R7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===h5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Yte(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Xte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===h5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...D7(o,c,c.position,!0)}:c}var B7={[f5.Left]:f5.Right,[f5.Right]:f5.Left,[f5.Top]:f5.Bottom,[f5.Bottom]:f5.Top},Zte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Zte.includes(`production`)}function U7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...P5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function Qte(e,t,n,r){if(!e||!e.source||!e.target)return n(new j7(k7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=R5(e)?e:{...e,id:J5(e)},i=W5(i,void 0,r),!Y5(i,t)&&i}function $te(e,t,n,r,i){if(!t.source||!t.target)return i(new j7(k7.EDGE_INVALID,e.id)),!1;if(!n)return i(new j7(k7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?J5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!z5(o)){n(new j7(k7.NODE_INVALID,o?.id));continue}let s=U5(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new j7(k7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function q7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function J7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;q7(`source`Line truncated
|
||||
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>`The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead`},j7=class extends Error{constructor(e,...t){super(A7[e]?.call(A7,...t)),this.name=`VueFlowError`,this.code=e,this.args=t}};function M7(e){return`clientX`in e}function Wte(e){return`sourceEvent`in e}function N7(e,t){let n=M7(e),r,i;return n?(r=e.clientX,i=e.clientY):`touches`in e&&e.touches.length>0?(r=e.touches[0].clientX,i=e.touches[0].clientY):`changedTouches`in e&&e.changedTouches.length>0?(r=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY):(r=0,i=0),{x:r-(t?.left??0),y:i-(t?.top??0)}}var P7=()=>typeof navigator<`u`&&(navigator==null?void 0:navigator.userAgent)?.indexOf(`Mac`)>=0;function Gte(e){return{width:e.dimensions?.width??e.width??0,height:e.dimensions?.height??e.height??0}}function F7(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}var Kte=()=>!0;function I7(e){e?.classList.remove(`valid`,`connecting`,`vue-flow__handle-valid`,`vue-flow__handle-connecting`)}function qte(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())N5(i,M5(e))>0&&r.push(e);return r}var Jte=250;function Yte(e,t,n,r){let i=[],a=1/0,o=qte(e,n,t+Jte);for(let n of o){let o=[...n.handleBounds?.source??[],...n.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=D7(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function L7(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=Kte},u,d,f,p){let m=a===`target`,h=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:g,y:_}=N7(e),v=o.elementFromPoint(g,_),y=v?.classList.contains(`${s}-flow__handle`)?v:h,b={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){let e=R7(void 0,y),t=y.getAttribute(`data-nodeid`),a=y.getAttribute(`data-handleid`),o=y.classList.contains(`connectable`),s=y.classList.contains(`connectableend`);if(!t||!e)return b;let c={source:m?t:r,sourceHandle:m?a:i,target:m?r:t,targetHandle:m?i:a};b.connection=c,b.isValid=o&&s&&(n===h5.Strict?m&&e===`source`||!m&&e===`target`:t!==r||a!==i)&&l(c,{nodes:d,edges:u,sourceNode:f(c.source),targetNode:f(c.target)}),b.toHandle=z7(t,e,a,p,n,!0)}return b}function R7(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function Xte(e,t){let n=null;return t?n=`valid`:e&&!t&&(n=`invalid`),n}function Zte(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}function z7(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===h5.Strict?o.handleBounds?.[t]:[...o.handleBounds?.source??[],...o.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...D7(o,c,c.position,!0)}:c}var B7={[f5.Left]:f5.Right,[f5.Right]:f5.Left,[f5.Top]:f5.Bottom,[f5.Bottom]:f5.Top},Qte=[`production`,`prod`];function V7(e,...t){H7()&&console.warn(`[Vue Flow]: ${e}`,...t)}function H7(){return!Qte.includes(`production`)}function U7(e,t,n,r,i){let a=t.querySelectorAll(`.vue-flow__handle.${e}`);return a?.length?Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...P5(t)}}):null}function W7(e,t,n,r,i,a=!1,o){i.value=!1,e.selected?(a||e.selected&&t)&&(r([e]),qn(()=>{o.blur()})):n([e])}function G7(e){return P(e)!==void 0}function $te(e,t,n,r){if(!e||!e.source||!e.target)return n(new j7(k7.EDGE_INVALID,e?.id??`[ID UNKNOWN]`)),!1;let i;return i=R5(e)?e:{...e,id:J5(e)},i=W5(i,void 0,r),!Y5(i,t)&&i}function ene(e,t,n,r,i){if(!t.source||!t.target)return i(new j7(k7.EDGE_INVALID,e.id)),!1;if(!n)return i(new j7(k7.EDGE_NOT_FOUND,e.id)),!1;let{id:a,...o}=e;return{...o,id:r?J5(t):a,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function K7(e,t,n){let r={},i=[];for(let a=0;a<e.length;++a){let o=e[a];if(!z5(o)){n(new j7(k7.NODE_INVALID,o?.id));continue}let s=U5(o,t(o.id),o.parentNode);o.parentNode&&(r[o.parentNode]=!0),i[a]=s}for(let e of i){let a=t(e.parentNode)||i.find(t=>t.id===e.parentNode);e.parentNode&&!a&&n(new j7(k7.NODE_MISSING_PARENT,e.id,e.parentNode)),(e.parentNode||r[e.id])&&(r[e.id]&&(e.isParent=!0),a&&(a.isParent=!0))}return i}function q7(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function J7(e,t,n){e.clear();for(let t of n){let{source:n,target:r,sourceHandle:i=null,targetHandle:a=null}=t,o={edgeId:t.id,source:n,target:r,sourceHandle:i,targetHandle:a},s=`${n}-${i}--${r}-${a}`;q7(`source`Line truncated
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import { computed, ref, watch } from "vue";
|
||||
|
||||
import LogRow from "@/base/LogRow.vue";
|
||||
import { Button } from "@/components/ui/button";
|
||||
@@ -58,10 +58,84 @@ const resolvedAttempt = computed(
|
||||
() => Number(props.attempt) || Number(props.state?.attempt) || 0,
|
||||
);
|
||||
|
||||
/** One page fetched for the pager: the before cursor it was read from. */
|
||||
interface LogPage {
|
||||
before: number;
|
||||
state: LogState;
|
||||
}
|
||||
|
||||
// The pager's own state: the older page the operator moved to, and the newer
|
||||
// pages to come back through. It is kept until the attempt or the filter
|
||||
// changes, so a live refresh of the tail cannot yank the operator out of a page
|
||||
// they deliberately moved to.
|
||||
const PAGE_LIMIT = 500;
|
||||
const page = ref<LogPage | null>(null);
|
||||
const newerPages = ref<LogPage[]>([]);
|
||||
const paging = ref(false);
|
||||
const pageError = ref(false);
|
||||
const pageKey = computed(
|
||||
() =>
|
||||
`${props.taskId}|${resolvedAttempt.value}|${props.filters.level}|${props.filters.stage}`,
|
||||
);
|
||||
watch(pageKey, () => {
|
||||
page.value = null;
|
||||
newerPages.value = [];
|
||||
pageError.value = false;
|
||||
});
|
||||
|
||||
/** The page on screen: the pager's, else the parent's tail page. */
|
||||
const current = computed<LogState | null | undefined>(
|
||||
() => page.value?.state ?? props.state,
|
||||
);
|
||||
// Paging is a property of the full-log pane, not the step pane's scoped view.
|
||||
const canPage = computed(() => props.taskId != null && props.filterable);
|
||||
const canOlder = computed(
|
||||
() => canPage.value && !!current.value?.more_available && (current.value?.cursor ?? 0) > 0,
|
||||
);
|
||||
const canNewer = computed(() => canPage.value && newerPages.value.length > 0);
|
||||
|
||||
/** Read the page ending just before cursor; zero reads the tail. */
|
||||
async function fetchPage(before: number): Promise<LogState | null> {
|
||||
if (props.taskId == null) return null;
|
||||
paging.value = true;
|
||||
pageError.value = false;
|
||||
try {
|
||||
return await api.taskLogs<LogState>(String(props.taskId), {
|
||||
attempt: resolvedAttempt.value || undefined,
|
||||
level: props.filters.level,
|
||||
stage: props.filters.stage,
|
||||
limit: PAGE_LIMIT,
|
||||
before: before || undefined,
|
||||
});
|
||||
} catch {
|
||||
pageError.value = true;
|
||||
return null;
|
||||
} finally {
|
||||
paging.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function loadOlder(): Promise<void> {
|
||||
const shown = current.value;
|
||||
const before = shown?.cursor ?? 0;
|
||||
if (!shown?.more_available || before <= 0) return;
|
||||
const older = await fetchPage(before);
|
||||
if (!older) return;
|
||||
newerPages.value.push({ before: page.value?.before ?? 0, state: shown });
|
||||
page.value = { before, state: older };
|
||||
}
|
||||
|
||||
function loadNewer(): void {
|
||||
const newer = newerPages.value.pop();
|
||||
if (!newer) return;
|
||||
pageError.value = false;
|
||||
page.value = newer;
|
||||
}
|
||||
|
||||
/** The pane's state, decided once so the announcement and the body can never
|
||||
* disagree about which case is on screen. */
|
||||
const view = computed(() => {
|
||||
const state = props.state;
|
||||
const state = current.value;
|
||||
if (state === undefined)
|
||||
return { kind: "loading" as const, status: "Loading this attempt's log" };
|
||||
if (state === null)
|
||||
@@ -180,6 +254,22 @@ const download = computed(() =>
|
||||
<p class="px-1 pt-2 text-xs text-fg-subtle">
|
||||
{{ attemptFooter(resolvedAttempt, view.entries.length) }}
|
||||
</p>
|
||||
<div v-if="canPage" class="mt-2 flex flex-wrap items-center gap-2 px-1">
|
||||
<Button variant="outline" size="sm" :disabled="!canOlder" @click="loadOlder">
|
||||
Load older
|
||||
</Button>
|
||||
<Button variant="outline" size="sm" :disabled="!canNewer || paging" @click="loadNewer">
|
||||
Load newer
|
||||
</Button>
|
||||
<span v-if="paging" class="text-xs text-fg-muted">Loading…</span>
|
||||
<span v-else-if="pageError" class="text-xs text-danger">Could not load that page</span>
|
||||
<span v-else-if="current?.more_available" class="text-xs text-fg-muted"
|
||||
>More available</span
|
||||
>
|
||||
</div>
|
||||
<p v-if="current?.truncated" class="px-1 pt-1 text-xs text-warn">
|
||||
The log is larger than the readable window; its oldest entries cannot be paged.
|
||||
</p>
|
||||
<Button v-if="download" variant="outline" size="sm" class="mt-3" as-child>
|
||||
<a :href="download" download>Download log</a>
|
||||
</Button>
|
||||
|
||||
@@ -115,6 +115,12 @@ export interface LogState {
|
||||
disabled?: boolean;
|
||||
attempt?: number;
|
||||
entries?: LogEntry[];
|
||||
/** Older entries were not examined: the file is larger than the scan window. */
|
||||
truncated?: boolean;
|
||||
/** Matching entries did not fit in this page; cursor continues the read. */
|
||||
more_available?: boolean;
|
||||
/** The byte-offset cursor to pass back as after_id for the next page. */
|
||||
cursor?: number;
|
||||
}
|
||||
|
||||
export interface CaptureFile {
|
||||
|
||||
Reference in new issue
Block a user