@w6w/embed 0.2.32 → 0.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{DocumentFormModal-Cw85R4wk.js → DocumentFormModal-B3OkvI5v.js} +2 -2
  2. package/dist/{DocumentFormModal-Cw85R4wk.js.map → DocumentFormModal-B3OkvI5v.js.map} +1 -1
  3. package/dist/{ImportSpecModal-fU5RsVTa.js → ImportSpecModal-SQvTwtcX.js} +2 -2
  4. package/dist/{ImportSpecModal-fU5RsVTa.js.map → ImportSpecModal-SQvTwtcX.js.map} +1 -1
  5. package/dist/WorkflowEditor-D2EfEP-U.js +1201 -0
  6. package/dist/WorkflowEditor-D2EfEP-U.js.map +1 -0
  7. package/dist/apps-CFWdgGst.js +106 -0
  8. package/dist/apps-CFWdgGst.js.map +1 -0
  9. package/dist/chrome/HistoryView.d.ts +3 -0
  10. package/dist/editor-apps-ShwCmvLY.js +178 -0
  11. package/dist/editor-apps-ShwCmvLY.js.map +1 -0
  12. package/dist/{editor-tools-Dn7TgCP4.js → editor-tools-rY9nddqr.js} +49 -49
  13. package/dist/{editor-tools-Dn7TgCP4.js.map → editor-tools-rY9nddqr.js.map} +1 -1
  14. package/dist/editor.mjs +1 -1
  15. package/dist/editors.mjs +8 -8
  16. package/dist/index.mjs +4 -4
  17. package/dist/lib/history-query.d.ts +22 -1
  18. package/dist/lib/run-log-nodes.d.ts +43 -0
  19. package/dist/lists.mjs +6 -6
  20. package/dist/rail.mjs +1 -1
  21. package/dist/repos/history.d.ts +5 -1
  22. package/dist/repos.mjs +304 -300
  23. package/dist/{spec-import-CGPqUUjN.js → spec-import-CPbDnnuv.js} +2 -2
  24. package/dist/{spec-import-CGPqUUjN.js.map → spec-import-CPbDnnuv.js.map} +1 -1
  25. package/dist/{workflows-Dz8LMjnt.js → workflows-RhR8kwt7.js} +255 -214
  26. package/dist/workflows-RhR8kwt7.js.map +1 -0
  27. package/package.json +3 -3
  28. package/dist/WorkflowEditor-C7oudiIb.js +0 -1169
  29. package/dist/WorkflowEditor-C7oudiIb.js.map +0 -1
  30. package/dist/apps-FMcQfyL2.js +0 -92
  31. package/dist/apps-FMcQfyL2.js.map +0 -1
  32. package/dist/editor-apps-HEOclsxL.js +0 -152
  33. package/dist/editor-apps-HEOclsxL.js.map +0 -1
  34. package/dist/workflows-Dz8LMjnt.js.map +0 -1
@@ -0,0 +1,178 @@
1
+ import { jsxs as C, jsx as u } from "react/jsx-runtime";
2
+ import { u as oe, a as se, b as ie, c as le, d as ce, e as ae } from "./apps-CFWdgGst.js";
3
+ import { r as ue, H as j, t as de } from "./workflows-RhR8kwt7.js";
4
+ import { ExecutionDetail as fe, ExecutionStats as ge, ExecutionFilters as pe, ExecutionList as me, useW6WApi as we } from "@w6w/ui";
5
+ import { useRef as w, useState as R, useEffect as W, useLayoutEffect as ye, useCallback as Y, useMemo as V } from "react";
6
+ import { useQuery as Ee } from "@tanstack/react-query";
7
+ const he = 300;
8
+ function D(o) {
9
+ for (let n = (o == null ? void 0 : o.parentElement) ?? null; n; n = n.parentElement) {
10
+ const l = getComputedStyle(n).overflowY;
11
+ if ((l === "auto" || l === "scroll") && n.scrollHeight > n.clientHeight)
12
+ return n;
13
+ }
14
+ return null;
15
+ }
16
+ function Re(o) {
17
+ var F, L, B;
18
+ const { scope: n, showKind: l, filters: t, onFiltersChange: g, onOpenInEditor: d, workflowId: p } = o, m = w(t);
19
+ m.current = t;
20
+ const [c, H] = R(t.q), f = w(null), [s, I] = R(null);
21
+ W(() => {
22
+ H(t.q);
23
+ }, [t.q]), W(
24
+ () => () => {
25
+ f.current && clearTimeout(f.current);
26
+ },
27
+ []
28
+ );
29
+ const y = oe(n, t), $ = se(n, t), x = ie(s), a = le(), K = ce(), [M, E] = R(null), h = w(null), b = w(null), O = (s == null ? void 0 : s.id) ?? null;
30
+ ye(() => {
31
+ var r;
32
+ const e = h.current;
33
+ if (e) {
34
+ if (O !== null) {
35
+ const i = D(e);
36
+ i ? i.scrollTop = 0 : e.getBoundingClientRect().top < 0 && ((r = e.scrollIntoView) == null || r.call(e, { block: "start" }));
37
+ } else if (b.current) {
38
+ const { parent: i, top: _ } = b.current;
39
+ b.current = null, i ? i.scrollTop = _ : window.scrollTo(0, _);
40
+ }
41
+ }
42
+ }, [O]);
43
+ const Q = w(s);
44
+ Q.current = s;
45
+ const k = Y((e) => {
46
+ if (Q.current === null) {
47
+ const r = D(h.current);
48
+ b.current = { parent: r, top: r ? r.scrollTop : window.scrollY };
49
+ }
50
+ I(e);
51
+ }, []), S = ((F = y.data) == null ? void 0 : F.executions) ?? [], T = ae([
52
+ ...p ? [p] : [],
53
+ ...S.filter((e) => e.kind === "workflow").map((e) => e.callableId)
54
+ ]), v = V(
55
+ () => S.map(
56
+ (e) => e.kind === "workflow" ? { ...e, triggerLabel: ue(e, T.get(e.callableId) ?? []) } : e
57
+ ),
58
+ [S, T]
59
+ ), G = (p ? T.get(p) ?? [] : []).map((e) => ({
60
+ // A manual run records no entry node, so the Manual trigger filters by run kind instead.
61
+ value: e.app === "@w6w/trigger" ? "kind:manual" : `entry:${e.nodeId}`,
62
+ label: e.label
63
+ })), q = t.offset, U = ((L = y.data) == null ? void 0 : L.hasMore) ?? !1, Z = (e) => {
64
+ const r = e.trigger ?? "";
65
+ g({
66
+ ...e,
67
+ trigger: Object.keys(de(r)).length > 0 ? r : "",
68
+ offset: 0
69
+ });
70
+ }, z = (e) => {
71
+ if (e.q === c) {
72
+ Z(e);
73
+ return;
74
+ }
75
+ H(e.q), f.current && clearTimeout(f.current), f.current = setTimeout(() => {
76
+ f.current = null, g({ ...m.current, q: e.q, offset: 0 });
77
+ }, he);
78
+ }, J = () => g({ ...t, q: c, offset: Math.max(0, q - j) }), X = () => g({ ...t, q: c, offset: q + j }), ee = Y(
79
+ (e) => {
80
+ const r = v.find((i) => i.id === e);
81
+ r && k(r);
82
+ },
83
+ [v, k]
84
+ ), N = (e) => {
85
+ a.mutate(e, {
86
+ onSuccess: (r) => {
87
+ r ? k(r) : I(null);
88
+ }
89
+ });
90
+ }, P = a.isPending ? ((B = a.variables) == null ? void 0 : B.id) ?? null : null, re = (e, r) => {
91
+ E(null), K(e, r).then((i) => {
92
+ i ? k(i) : E(`${r} is no longer available.`);
93
+ }).catch(() => E(`Couldn't open ${r}.`));
94
+ }, A = a.isError ? /* @__PURE__ */ C("p", { className: "error", "data-testid": "history-rerun-error", children: [
95
+ "Couldn't re-run: ",
96
+ a.error instanceof Error ? a.error.message : String(a.error)
97
+ ] }) : null, te = {
98
+ status: t.status,
99
+ kind: t.kind,
100
+ from: t.from,
101
+ to: t.to,
102
+ q: c,
103
+ trigger: t.trigger
104
+ }, ne = (s == null ? void 0 : s.kind) === "workflow" && d ? () => d(s) : void 0;
105
+ return s ? /* @__PURE__ */ C("div", { ref: h, children: [
106
+ A,
107
+ M && /* @__PURE__ */ u("p", { className: "error", "data-testid": "history-find-error", children: M }),
108
+ /* @__PURE__ */ u(
109
+ fe,
110
+ {
111
+ execution: x.data ?? null,
112
+ loading: x.isLoading,
113
+ errorMessage: x.isError ? "This execution is no longer available." : void 0,
114
+ onBack: () => {
115
+ a.reset(), E(null), I(null);
116
+ },
117
+ onOpenExecution: (e) => re(s.callableId, e),
118
+ onRerun: () => N(s),
119
+ rerunning: P !== null,
120
+ onOpenInEditor: ne
121
+ }
122
+ )
123
+ ] }) : /* @__PURE__ */ C("div", { className: "w6w-card-stack", "data-testid": "history-view", children: [
124
+ /* @__PURE__ */ u(ge, { stats: $.data ?? null }),
125
+ /* @__PURE__ */ u(
126
+ pe,
127
+ {
128
+ showKind: l,
129
+ value: te,
130
+ onChange: z,
131
+ triggerOptions: G
132
+ }
133
+ ),
134
+ y.isError && /* @__PURE__ */ u("p", { className: "error", "data-testid": "history-error", children: "Couldn't load execution history." }),
135
+ A,
136
+ /* @__PURE__ */ u("div", { ref: h, children: /* @__PURE__ */ u(
137
+ me,
138
+ {
139
+ items: v,
140
+ showCallable: l,
141
+ loading: y.isLoading,
142
+ hasPrev: q > 0,
143
+ hasNext: U,
144
+ onPrev: J,
145
+ onNext: X,
146
+ onSelect: ee,
147
+ onRerun: (e) => {
148
+ const r = v.find((i) => i.id === e);
149
+ r && N(r);
150
+ },
151
+ rerunningId: P
152
+ }
153
+ ) })
154
+ ] });
155
+ }
156
+ const be = /* @__PURE__ */ new Map();
157
+ function ke(o) {
158
+ var m;
159
+ const n = we(), l = (m = n.listAppsByIds) == null ? void 0 : m.bind(n), t = [...o].sort().join(","), d = Ee({
160
+ queryKey: ["editor-apps", t],
161
+ queryFn: ({ signal: c }) => l ? l(o, { signal: c }) : Promise.resolve([]),
162
+ enabled: o.length > 0 && typeof l == "function"
163
+ }).data;
164
+ return { byId: V(
165
+ () => d ? new Map(d.map((c) => [c.id, c])) : be,
166
+ [d]
167
+ ) };
168
+ }
169
+ function He(o) {
170
+ const { byId: n } = ke(o ? [o] : []);
171
+ return o ? n.get(o) : void 0;
172
+ }
173
+ export {
174
+ Re as H,
175
+ ke as a,
176
+ He as u
177
+ };
178
+ //# sourceMappingURL=editor-apps-ShwCmvLY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor-apps-ShwCmvLY.js","sources":["../src/chrome/HistoryView.tsx","../src/editor/editor-apps.ts"],"sourcesContent":["/**\n * `HistoryView` — the execution-history view body (T3.2.1, extracted from\n * `HistoryPage.tsx`'s T2.4.1 shape): stats + filters + paged list, OR the\n * selected execution's detail — never both. Opening a row swaps the list for\n * that execution (with a Back control to return to the list where it was\n * left); it does not stack the detail under a long list, where it lands\n * off-screen. Two hosts mount it — `HistoryPage` (the\n * project-wide and per-callable routes, filters URL-backed) and\n * `HistoryModal` (R-2's in-place modal, filters kept in local state) — so\n * this component owns every judgment call about HOW the view behaves, and\n * takes no position on WHERE its filters live: the host hands down\n * `filters` and gets every change back through `onFiltersChange`, exactly\n * the controlled-value shape `filtersToSearch`/`filtersFromSearch` already\n * assume on the URL-backed side.\n *\n * What stays here, same as it was in `HistoryPage` before the extraction:\n * - the search box's text, debounced, so a keystroke does not re-key and\n * re-issue both queries on every character (`onFiltersChange` — and so\n * the host's own write, URL or local state — fires only once typing\n * settles);\n * - which list row is selected, which is not shareable state and resets on\n * every mount;\n * - re-running an execution (a control on every row and in the detail): the\n * same input, against the callable's current definition. The view then\n * opens the NEW execution, so the outcome is what the author sees next;\n * - every filter change but paging snapping the page back to the first\n * (`offset` 0), because a narrowed result set has no meaningful \"page 3\".\n *\n * `onOpenInEditor`, when given, is called with the selected execution ONLY\n * while it is a workflow run (a function/endpoint invocation has no visual\n * editor to open) — the same gate `HistoryPage.tsx` applied inline before\n * this extraction. A host that never passes it (none of today's two do)\n * simply never sees the call.\n */\nimport {\n type ExecutionSummary,\n HISTORY_PAGE_SIZE,\n type HistoryFilters,\n type HistoryScope,\n runTriggerLabel,\n triggerFilterQuery,\n useExecutionDetailQuery,\n useFindExecution,\n useHistoryQuery,\n useHistoryStatsQuery,\n useRerunExecutionMutation,\n useWorkflowTriggers,\n} from \"@w6w/embed/repos\";\nimport {\n ExecutionDetail,\n type ExecutionFilterValue,\n ExecutionFilters,\n ExecutionList,\n ExecutionStats,\n} from \"@w6w/ui\";\nimport { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from \"react\";\n\n/** How long to wait after the last keystroke before `onFiltersChange` fires\n * with the new `q` (and so before either query re-issues with it). */\nconst SEARCH_DEBOUNCE_MS = 300;\n\n/** The nearest ancestor that actually scrolls (the modal body, the app's main\n * pane), or `null` when the document itself does. */\nfunction scrollParent(el: HTMLElement | null): HTMLElement | null {\n for (let p = el?.parentElement ?? null; p; p = p.parentElement) {\n const overflowY = getComputedStyle(p).overflowY;\n if ((overflowY === \"auto\" || overflowY === \"scroll\") && p.scrollHeight > p.clientHeight) {\n return p;\n }\n }\n return null;\n}\n\nexport interface HistoryViewProps {\n /** `null` ⇒ no scope known yet (the project-wide host, before its project\n * resolves) — both queries stay disabled, mirroring `repos/history.ts`'s\n * own `enabled: scope !== null`. */\n scope: HistoryScope | null;\n /** Project-wide chrome: the Kind filter, and the Callable column on every\n * row. A per-callable host (every callable already knows its own kind)\n * passes `false`. */\n showKind: boolean;\n filters: HistoryFilters;\n onFiltersChange: (next: HistoryFilters) => void;\n onOpenInEditor?: (execution: ExecutionSummary) => void;\n /** The scope is this one workflow: offer its triggers as a filter (\"which trigger started the\n * run\"), so one trigger's runs and stats can be reviewed on their own. */\n workflowId?: string;\n}\n\nexport function HistoryView(props: HistoryViewProps) {\n const { scope, showKind, filters, onFiltersChange, onOpenInEditor, workflowId } = props;\n\n // The debounce below fires outside any render, so it needs the LATEST\n // filters (a status picked while a `q` write was still pending must\n // survive it) rather than the ones captured when typing started.\n const filtersRef = useRef(filters);\n filtersRef.current = filters;\n\n const [q, setQ] = useState(filters.q);\n const searchTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n const [selected, setSelected] = useState<ExecutionSummary | null>(null);\n\n // Keep the search box in step with `filters.q` when IT moves from outside\n // (Back/Forward or a shared link on the URL-backed host). This never\n // fights a keystroke: an outside `q` only changes once typing has\n // settled, by which point `q` already equals it.\n useEffect(() => {\n setQ(filters.q);\n }, [filters.q]);\n\n // Drop a pending debounce on unmount.\n useEffect(\n () => () => {\n if (searchTimer.current) clearTimeout(searchTimer.current);\n },\n [],\n );\n\n const listQuery = useHistoryQuery(scope, filters);\n const statsQuery = useHistoryStatsQuery(scope, filters);\n const detailQuery = useExecutionDetailQuery(selected);\n const rerun = useRerunExecutionMutation();\n const findExecution = useFindExecution();\n const [findError, setFindError] = useState<string | null>(null);\n\n // Swapping list ⇄ detail keeps the scroll offset of whatever scrolls around\n // this view, which would open a detail scrolled past its own top (the row\n // was clicked far down the list). So: remember the list's offset on the\n // way in, show the detail from its top, and put the list back on the way out.\n const viewRef = useRef<HTMLDivElement>(null);\n const listScroll = useRef<{ parent: HTMLElement | null; top: number } | null>(null);\n const selectedId = selected?.id ?? null;\n useLayoutEffect(() => {\n const el = viewRef.current;\n if (!el) return;\n if (selectedId !== null) {\n const parent = scrollParent(el);\n if (parent) parent.scrollTop = 0;\n else if (el.getBoundingClientRect().top < 0) el.scrollIntoView?.({ block: \"start\" });\n } else if (listScroll.current) {\n const { parent, top } = listScroll.current;\n listScroll.current = null;\n if (parent) parent.scrollTop = top;\n else window.scrollTo(0, top);\n }\n }, [selectedId]);\n\n const selectedRef = useRef(selected);\n selectedRef.current = selected;\n const open = useCallback((next: ExecutionSummary) => {\n // Leaving the LIST (not one detail for another, as a re-run from the detail does).\n if (selectedRef.current === null) {\n const parent = scrollParent(viewRef.current);\n listScroll.current = { parent, top: parent ? parent.scrollTop : window.scrollY };\n }\n setSelected(next);\n }, []);\n\n const rows = listQuery.data?.executions ?? [];\n // Every listed workflow's triggers, so each row names the trigger that started it — a run list\n // mixing three triggers is unreadable as `Event · <node id>` until each row is opened.\n const triggersByWorkflow = useWorkflowTriggers([\n ...(workflowId ? [workflowId] : []),\n ...rows.filter((r) => r.kind === \"workflow\").map((r) => r.callableId),\n ]);\n const executions = useMemo(\n () =>\n rows.map((r) =>\n r.kind === \"workflow\"\n ? { ...r, triggerLabel: runTriggerLabel(r, triggersByWorkflow.get(r.callableId) ?? []) }\n : r,\n ),\n [rows, triggersByWorkflow],\n );\n const ownTriggers = workflowId ? (triggersByWorkflow.get(workflowId) ?? []) : [];\n const triggerOptions = ownTriggers.map((t) => ({\n // A manual run records no entry node, so the Manual trigger filters by run kind instead.\n value: t.app === \"@w6w/trigger\" ? \"kind:manual\" : `entry:${t.nodeId}`,\n label: t.label,\n }));\n const offset = filters.offset;\n const hasMore = listQuery.data?.hasMore ?? false;\n\n /** Every filter change but paging reports a fresh filter set and resets\n * the page to the first. */\n const applyFilters = (next: ExecutionFilterValue) => {\n const trigger = next.trigger ?? \"\";\n onFiltersChange({\n ...next,\n trigger: Object.keys(triggerFilterQuery(trigger)).length > 0 ? trigger : \"\",\n offset: 0,\n });\n };\n\n const onChange = (next: ExecutionFilterValue) => {\n if (next.q === q) {\n applyFilters(next);\n return;\n }\n setQ(next.q);\n if (searchTimer.current) clearTimeout(searchTimer.current);\n searchTimer.current = setTimeout(() => {\n searchTimer.current = null;\n onFiltersChange({ ...filtersRef.current, q: next.q, offset: 0 });\n }, SEARCH_DEBOUNCE_MS);\n };\n\n const onPrev = () =>\n onFiltersChange({ ...filters, q, offset: Math.max(0, offset - HISTORY_PAGE_SIZE) });\n const onNext = () => onFiltersChange({ ...filters, q, offset: offset + HISTORY_PAGE_SIZE });\n\n const onSelect = useCallback(\n (executionId: string) => {\n const row = executions.find((r) => r.id === executionId);\n if (row) open(row);\n },\n [executions, open],\n );\n\n /** Re-run one execution, then open the new one — or, when it is not listed\n * yet, fall back to the (refreshed) list. */\n const startRerun = (summary: ExecutionSummary) => {\n rerun.mutate(summary, {\n onSuccess: (next) => {\n if (next) open(next);\n else setSelected(null);\n },\n });\n };\n const rerunningId = rerun.isPending ? (rerun.variables?.id ?? null) : null;\n\n /** \"Re-run of <id>\": open the original, from the callable this one belongs to. */\n const openOriginal = (callableId: string, id: string) => {\n setFindError(null);\n findExecution(callableId, id)\n .then((row) => {\n if (row) open(row);\n else setFindError(`${id} is no longer available.`);\n })\n .catch(() => setFindError(`Couldn't open ${id}.`));\n };\n const rerunError = rerun.isError ? (\n <p className=\"error\" data-testid=\"history-rerun-error\">\n Couldn't re-run: {rerun.error instanceof Error ? rerun.error.message : String(rerun.error)}\n </p>\n ) : null;\n\n const filterValue: ExecutionFilterValue = {\n status: filters.status,\n kind: filters.kind,\n from: filters.from,\n to: filters.to,\n q,\n trigger: filters.trigger,\n };\n\n // A workflow run is the only execution with a visual editor to jump into\n // — a function/endpoint invocation has no such surface.\n const openInEditor =\n selected?.kind === \"workflow\" && onOpenInEditor ? () => onOpenInEditor(selected) : undefined;\n\n if (selected) {\n return (\n <div ref={viewRef}>\n {rerunError}\n {findError && (\n <p className=\"error\" data-testid=\"history-find-error\">\n {findError}\n </p>\n )}\n <ExecutionDetail\n execution={detailQuery.data ?? null}\n loading={detailQuery.isLoading}\n errorMessage={detailQuery.isError ? \"This execution is no longer available.\" : undefined}\n onBack={() => {\n rerun.reset();\n setFindError(null);\n setSelected(null);\n }}\n onOpenExecution={(id) => openOriginal(selected.callableId, id)}\n onRerun={() => startRerun(selected)}\n rerunning={rerunningId !== null}\n onOpenInEditor={openInEditor}\n />\n </div>\n );\n }\n\n // `.w6w-card-stack` spaces stats → filters → list. A bare fragment left them touching: every host\n // wraps this view in one element (`RunHistory`'s embed root, `HistoryModal`'s body), so the\n // page's own flex gap never reached these siblings.\n return (\n <div className=\"w6w-card-stack\" data-testid=\"history-view\">\n <ExecutionStats stats={statsQuery.data ?? null} />\n\n <ExecutionFilters\n showKind={showKind}\n value={filterValue}\n onChange={onChange}\n triggerOptions={triggerOptions}\n />\n\n {listQuery.isError && (\n <p className=\"error\" data-testid=\"history-error\">\n Couldn't load execution history.\n </p>\n )}\n\n {rerunError}\n\n <div ref={viewRef}>\n <ExecutionList\n items={executions}\n showCallable={showKind}\n loading={listQuery.isLoading}\n hasPrev={offset > 0}\n hasNext={hasMore}\n onPrev={onPrev}\n onNext={onNext}\n onSelect={onSelect}\n onRerun={(id) => {\n const row = executions.find((r) => r.id === id);\n if (row) startRerun(row);\n }}\n rerunningId={rerunningId}\n />\n </div>\n </div>\n );\n}\n","/**\n * The canvas's app lookups, through the host-provided `W6WApi` (`useW6WApi()` — in an embed that\n * is `createW6WUiAdapter`'s, in Studio the facade, which delegates to the same store/repo).\n */\nimport { useQuery } from \"@tanstack/react-query\";\nimport { type AppSummary, useW6WApi } from \"@w6w/ui\";\nimport { useMemo } from \"react\";\n\n/** The per-app actions query key — the repos export itself (one declaration, no copy). */\nexport { appActionsKey } from \"../repos/apps.ts\";\n\nconst NO_APPS: ReadonlyMap<string, AppSummary> = new Map();\n\n/** A bounded set of app records by id. Empty when the host's API has no `listAppsByIds`. */\nexport function useEditorApps(ids: readonly string[]): { byId: ReadonlyMap<string, AppSummary> } {\n const api = useW6WApi();\n const list = api.listAppsByIds?.bind(api);\n const key = [...ids].sort().join(\",\");\n const q = useQuery({\n queryKey: [\"editor-apps\", key],\n queryFn: ({ signal }) => (list ? list(ids, { signal }) : Promise.resolve([] as AppSummary[])),\n enabled: ids.length > 0 && typeof list === \"function\",\n });\n const data = q.data;\n const byId = useMemo(\n () => (data ? new Map(data.map((a) => [a.id, a] as const)) : NO_APPS),\n [data],\n );\n return { byId };\n}\n\n/**\n * One app record by id, over {@link useEditorApps} (same `/apps` request, same cache entry as the\n * canvas's batch lookup). `undefined` while loading, for an empty id (which issues no request),\n * or when the host's API cannot look apps up by id.\n */\nexport function useEditorApp(id: string): AppSummary | undefined {\n const { byId } = useEditorApps(id ? [id] : []);\n return id ? byId.get(id) : undefined;\n}\n"],"names":["SEARCH_DEBOUNCE_MS","scrollParent","el","p","overflowY","HistoryView","props","scope","showKind","filters","onFiltersChange","onOpenInEditor","workflowId","filtersRef","useRef","q","setQ","useState","searchTimer","selected","setSelected","useEffect","listQuery","useHistoryQuery","statsQuery","useHistoryStatsQuery","detailQuery","useExecutionDetailQuery","rerun","useRerunExecutionMutation","findExecution","useFindExecution","findError","setFindError","viewRef","listScroll","selectedId","useLayoutEffect","parent","top","selectedRef","open","useCallback","next","rows","_a","triggersByWorkflow","useWorkflowTriggers","r","executions","useMemo","runTriggerLabel","triggerOptions","t","offset","hasMore","_b","applyFilters","trigger","triggerFilterQuery","onChange","onPrev","HISTORY_PAGE_SIZE","onNext","onSelect","executionId","row","startRerun","summary","rerunningId","_c","openOriginal","callableId","id","rerunError","jsxs","filterValue","openInEditor","jsx","ExecutionDetail","ExecutionStats","ExecutionFilters","ExecutionList","NO_APPS","useEditorApps","ids","api","useW6WApi","list","key","data","useQuery","signal","a","useEditorApp","byId"],"mappings":";;;;;;AA2DA,MAAMA,KAAqB;AAI3B,SAASC,EAAaC,GAA4C;AAChE,WAASC,KAAID,KAAA,gBAAAA,EAAI,kBAAiB,MAAMC,GAAGA,IAAIA,EAAE,eAAe;AAC9D,UAAMC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,IACjB,UAAU,CAAC,eAAeF,CAAG;AAAA,IAC7B,SAAS,CAAC,EAAE,QAAAG,EAAA,MAAcJ,IAAOA,EAAKH,GAAK,EAAE,QAAAO,GAAQ,IAAI,QAAQ,QAAQ,CAAA,CAAkB;AAAA,IAC3F,SAASP,EAAI,SAAS,KAAK,OAAOG,KAAS;AAAA,EAAA,CAC5C,EACc;AAKf,SAAO,EAAE,MAJItC;AAAA,IACX,MAAOwC,IAAO,IAAI,IAAIA,EAAK,IAAI,CAACG,MAAM,CAACA,EAAE,IAAIA,CAAC,CAAU,CAAC,IAAIV;AAAA,IAC7D,CAACO,CAAI;AAAA,EAAA,EAEE;AACX;AAOO,SAASI,GAAarB,GAAoC;AAC/D,QAAM,EAAE,MAAAsB,MAASX,GAAcX,IAAK,CAACA,CAAE,IAAI,EAAE;AAC7C,SAAOA,IAAKsB,EAAK,IAAItB,CAAE,IAAI;AAC7B;"}
@@ -1,23 +1,23 @@
1
1
  import { jsx as n, jsxs as r, Fragment as V } from "react/jsx-runtime";
2
2
  import { r as Cn, l as We, m as $e, d as Re, e as En, h as je, c as An } from "./import-bindings-EUtxZ9Ti.js";
3
3
  import { useContext as ve, useState as u, useMemo as Fe, useEffect as be, createContext as He, useRef as qe } from "react";
4
- import { ExpressionOptionsProvider as Je, Icon as K, RetryPolicyFields as Pn, StepBuilderModal as In, IconButton as Se, useEnterSubmit as Tn, CodeBlock as ge, DeleteButton as Dn, EditButton as On, ConfirmModal as Le, JsonEditor as Mn, useExpressionOptions as Rn, ExpressionInput as jn, ResultViewer as Ln } from "@w6w/ui";
4
+ import { ExpressionOptionsProvider as Je, Icon as K, RetryPolicyFields as Pn, StepBuilderModal as Tn, IconButton as Se, useEnterSubmit as In, CodeBlock as ge, DeleteButton as Dn, EditButton as On, ConfirmModal as Le, JsonEditor as Mn, useExpressionOptions as Rn, ExpressionInput as jn, ResultViewer as Ln } from "@w6w/ui";
5
5
  import { d as Vn, p as Qn, i as Wn, t as $n, e as Ve, a as Fn, h as Hn, s as qn } from "./document-sources-Khcw2zB5.js";
6
6
  import { u as Jn, a as Be } from "./spec-export-BtnoV0ex.js";
7
- import { i as Bn, f as Kn, e as Un, b as _n, u as zn } from "./vault-BSEWhMYC.js";
8
- import { k as Gn, q as Yn, n as Zn, l as Xn, r as Ke, m as Ue, o as _e } from "./spec-import-CGPqUUjN.js";
7
+ import { i as Bn, f as Kn, e as Un, b as zn, u as _n } from "./vault-BSEWhMYC.js";
8
+ import { k as Gn, q as Yn, n as Zn, l as Xn, r as Ke, m as Ue, o as ze } from "./spec-import-CPbDnnuv.js";
9
9
  import { s as xn, M as B, c as et, C as nt } from "./ConfirmModal-WqBfWftD.js";
10
10
  import { u as tt, i as it, f as st } from "./slug-BVdgiP_L.js";
11
11
  import { WorkflowConnectionsPanel as at } from "@w6w/ui/flow";
12
12
  import { ApiError as j } from "@w6w/sdk";
13
- import { c as ze } from "./callable-record-Bhxim8C1.js";
13
+ import { c as _e } from "./callable-record-Bhxim8C1.js";
14
14
  import { i as rt, d as ot, p as lt } from "./settings-rail-gUU2ZbSw.js";
15
15
  import { s as Ge, r as Ye, v as Ze, t as Xe, b as xe, d as dt, g as ct, u as ut, q as ht, p as ft, o as mt, n as pt } from "./endpoints-zOuwci2U.js";
16
- import { a1 as en, a0 as gt, _ as vt, P as bt, U as yt, a3 as kt, Z as wt, V as Nt, X as St, K as Ct, I as Et } from "./workflows-Dz8LMjnt.js";
16
+ import { a3 as en, a2 as gt, a0 as vt, T as bt, W as yt, a6 as kt, $ as wt, X as Nt, Z as St, M as Ct, K as Et } from "./workflows-RhR8kwt7.js";
17
17
  import { j as At } from "./callables-B49tS2vv.js";
18
- import { I as nn } from "./ImportSpecModal-fU5RsVTa.js";
18
+ import { I as nn } from "./ImportSpecModal-SQvTwtcX.js";
19
19
  import { useQueryClient as Pt } from "@tanstack/react-query";
20
- import { foldStateLog as It } from "@w6w/expr";
20
+ import { foldStateLog as Tt } from "@w6w/expr";
21
21
  const ye = He(null);
22
22
  function Fi({
23
23
  children: e,
@@ -35,7 +35,7 @@ function qi(e) {
35
35
  const { setCallable: i } = t, s = e ? JSON.stringify(e) : "";
36
36
  be(() => (i(e), () => i(null)), [s, i]);
37
37
  }
38
- function Tt() {
38
+ function It() {
39
39
  const e = ve(ye);
40
40
  if (!e) throw new Error("useWorkspaceCallable must be used within <WorkspaceProvider>");
41
41
  return e.resource;
@@ -107,12 +107,12 @@ function Ji({
107
107
  tools: e,
108
108
  storageKey: t
109
109
  }) {
110
- const i = Tt(), s = e.filter((a) => a.isAvailable(i));
110
+ const i = It(), s = e.filter((a) => a.isAvailable(i));
111
111
  return s.length === 0 ? null : t === null ? /* @__PURE__ */ n(sn, { tools: s, ctx: i, state: tn, onToggle: () => {
112
112
  } }) : /* @__PURE__ */ n(Ot, { storageKey: t, tools: s, ctx: i }, t);
113
113
  }
114
114
  function Mt(e) {
115
- const t = e, i = Bn(t ?? void 0, t != null), s = Kn(), a = Jn(), o = Gn(t ?? void 0, t != null), l = Un(), d = _n(), h = zn();
115
+ const t = e, i = Bn(t ?? void 0, t != null), s = Kn(), a = Jn(), o = Gn(t ?? void 0, t != null), l = Un(), d = zn(), h = _n();
116
116
  return Fe(
117
117
  () => ({
118
118
  vars: (i.data ?? []).map((c) => c.name),
@@ -370,7 +370,7 @@ function on({
370
370
  D === "warn" && /* @__PURE__ */ n("div", { className: "result error", "data-testid": "rail-errorhandling-self-caution", children: "This handler targets itself. Its imported input adapter is preserved; the server will refuse it if it resolves to the failed call's same inputs." }),
371
371
  b && /* @__PURE__ */ n("div", { className: "error", "data-testid": "rail-errorhandling-error", children: b }),
372
372
  c && /* @__PURE__ */ n(
373
- In,
373
+ Tn,
374
374
  {
375
375
  appsOnly: !0,
376
376
  callables: ["function", "workflow"],
@@ -396,7 +396,7 @@ function Ft({ ctx: e }) {
396
396
  );
397
397
  }
398
398
  function Ht({ id: e, kind: t }) {
399
- const i = Ge(e, t === "function"), s = Ye(e, t === "endpoint"), a = Ze(), o = Xe(), l = ze(t, t === "function" ? i.data : s.data), d = t === "function" ? a.isPending : o.isPending;
399
+ const i = Ge(e, t === "function"), s = Ye(e, t === "endpoint"), a = Ze(), o = Xe(), l = _e(t, t === "function" ? i.data : s.data), d = t === "function" ? a.isPending : o.isPending;
400
400
  return /* @__PURE__ */ n(
401
401
  on,
402
402
  {
@@ -449,10 +449,10 @@ function Ut(e, t) {
449
449
  }
450
450
  return { tags: i, typed: "" };
451
451
  }
452
- function _t(e, t) {
452
+ function zt(e, t) {
453
453
  return e.filter((i) => i !== t);
454
454
  }
455
- function zt({ tags: e, onChange: t }) {
455
+ function _t({ tags: e, onChange: t }) {
456
456
  const [i, s] = u("");
457
457
  function a(o) {
458
458
  const l = Ut(e, o);
@@ -468,7 +468,7 @@ function zt({ tags: e, onChange: t }) {
468
468
  icon: "close",
469
469
  label: `Remove tag ${o}`,
470
470
  title: `Remove ${o}`,
471
- onClick: () => t(_t(e, o))
471
+ onClick: () => t(zt(e, o))
472
472
  }
473
473
  )
474
474
  ] }, o)),
@@ -502,7 +502,7 @@ function ln(e) {
502
502
  }
503
503
  }
504
504
  }
505
- const Q = Tn(R, { enabled: y });
505
+ const Q = In(R, { enabled: y });
506
506
  return /* @__PURE__ */ r(B, { title: "Edit settings", onClose: e.onClose, children: [
507
507
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
508
508
  /* @__PURE__ */ r("label", { className: "field", children: [
@@ -538,7 +538,7 @@ function ln(e) {
538
538
  ] }),
539
539
  t.hasTags && /* @__PURE__ */ r("div", { children: [
540
540
  /* @__PURE__ */ n("p", { className: "muted small", style: { marginBottom: "8px" }, children: "Tags" }),
541
- /* @__PURE__ */ n(zt, { tags: d, onChange: h })
541
+ /* @__PURE__ */ n(_t, { tags: d, onChange: h })
542
542
  ] }),
543
543
  b && /* @__PURE__ */ n("div", { className: "error", children: b })
544
544
  ] }),
@@ -938,12 +938,12 @@ function Xt({
938
938
  setHistoryOpen: d,
939
939
  versionListOpen: h,
940
940
  setVersionListOpen: c
941
- } = s, v = en(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = gt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = qe(!1), [M, y] = u(!1), [R, Q] = u(!1), [N, g] = u(!1), [A, q] = u(!1), [U, W] = u(!1), [$, oe] = u(null), [_, le] = u(null), F = Be(We("workflow"), m, N), z = Ke("workflow", m, l && b), te = Ue("workflow"), de = _e("workflow"), [ke, G] = u(null), [ie, ce] = u(null), [se, ue] = u(
941
+ } = s, v = en(t ?? void 0), b = (e == null ? void 0 : e.kind) === "workflow", m = (e == null ? void 0 : e.id) ?? "", C = gt(m, b), k = vt(t ?? void 0), D = bt(), O = yt(), E = qe(!1), [M, y] = u(!1), [R, Q] = u(!1), [N, g] = u(!1), [A, q] = u(!1), [U, W] = u(!1), [$, oe] = u(null), [z, le] = u(null), F = Be(We("workflow"), m, N), _ = Ke("workflow", m, l && b), te = Ue("workflow"), de = ze("workflow"), [ke, G] = u(null), [ie, ce] = u(null), [se, ue] = u(
942
942
  null
943
943
  );
944
944
  if (!e || e.kind !== "workflow")
945
945
  return /* @__PURE__ */ n("p", { className: "muted small", children: "Open a workflow to see its settings." });
946
- const I = (ae = v.data) == null ? void 0 : ae.find((f) => f.id === e.id), he = I && typeof I.displayName == "string" ? I.displayName : "", H = (I == null ? void 0 : I.tags) ?? [], Y = (I == null ? void 0 : I.status) === "archived";
946
+ const T = (ae = v.data) == null ? void 0 : ae.find((f) => f.id === e.id), he = T && typeof T.displayName == "string" ? T.displayName : "", H = (T == null ? void 0 : T.tags) ?? [], Y = (T == null ? void 0 : T.status) === "archived";
947
947
  async function Z() {
948
948
  if (!E.current) {
949
949
  E.current = !0, oe(null);
@@ -1004,7 +1004,7 @@ function Xt({
1004
1004
  id: e.id,
1005
1005
  displayName: he,
1006
1006
  fields: $e("workflow"),
1007
- row: I,
1007
+ row: T,
1008
1008
  tags: H
1009
1009
  }
1010
1010
  ),
@@ -1015,7 +1015,7 @@ function Xt({
1015
1015
  definitionStatus: e.definitionStatus,
1016
1016
  publishDisabled: e.publishDisabled,
1017
1017
  open: l,
1018
- versions: z.data,
1018
+ versions: _.data,
1019
1019
  publishing: te.isPending,
1020
1020
  togglingEnabled: de.isPending,
1021
1021
  publishError: ke,
@@ -1035,7 +1035,7 @@ function Xt({
1035
1035
  onToggleEnabled: () => {
1036
1036
  var f;
1037
1037
  ce(null), de.mutate(
1038
- { id: m, enabled: !((f = z.data) != null && f.enabled) },
1038
+ { id: m, enabled: !((f = _.data) != null && f.enabled) },
1039
1039
  { onError: (P) => ce(P instanceof j ? P.message : String(P)) }
1040
1040
  );
1041
1041
  }
@@ -1044,8 +1044,8 @@ function Xt({
1044
1044
  h && /* @__PURE__ */ n(
1045
1045
  pn,
1046
1046
  {
1047
- loading: z.isLoading,
1048
- versions: (me = z.data) == null ? void 0 : me.versions,
1047
+ loading: _.isLoading,
1048
+ versions: (me = _.data) == null ? void 0 : me.versions,
1049
1049
  onSelect: (f) => ue({ id: m, versionNumber: f }),
1050
1050
  onClose: () => c(!1)
1051
1051
  }
@@ -1097,14 +1097,14 @@ function Xt({
1097
1097
  ) }) : null }),
1098
1098
  /* @__PURE__ */ n("div", { className: "modal-actions", children: /* @__PURE__ */ n("button", { type: "button", className: "btn ghost", onClick: () => g(!1), children: "Close" }) })
1099
1099
  ] }),
1100
- a && I && /* @__PURE__ */ n(
1100
+ a && T && /* @__PURE__ */ n(
1101
1101
  ln,
1102
1102
  {
1103
1103
  kind: "workflow",
1104
1104
  id: m,
1105
1105
  initial: {
1106
1106
  displayName: he,
1107
- key: I.key ?? null,
1107
+ key: T.key ?? null,
1108
1108
  tags: H
1109
1109
  },
1110
1110
  onSave: async (f) => {
@@ -1134,7 +1134,7 @@ function Xt({
1134
1134
  deleteConfirming: A,
1135
1135
  archiveConfirming: U,
1136
1136
  deleteError: $,
1137
- archiveError: _,
1137
+ archiveError: z,
1138
1138
  onRequestDelete: () => q(!0),
1139
1139
  onRequestArchive: () => W(!0),
1140
1140
  onConfirmDelete: Z,
@@ -1172,7 +1172,7 @@ function ei({
1172
1172
  onNavigate: i,
1173
1173
  open: s
1174
1174
  }) {
1175
- var Pe, Ie, Te;
1175
+ var Pe, Te, Ie;
1176
1176
  const {
1177
1177
  editingSettings: a,
1178
1178
  setEditingSettings: o,
@@ -1180,12 +1180,12 @@ function ei({
1180
1180
  setHistoryOpen: d,
1181
1181
  versionListOpen: h,
1182
1182
  setVersionListOpen: c
1183
- } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = xe(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, M] = u(null), [y, R] = u(null), [Q, N] = u(!1), [g, A] = u(!1), [q, U] = u(!1), [W, $] = u(!1), [oe, _] = u(!1), [le, F] = u(null), [z, te] = u(null), de = Ge((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = Ye((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Ze(), ie = Xe(), ce = ht(), se = ft(), ue = mt(), I = pt(), he = e ? We(e.kind) : null, H = Be(he, (e == null ? void 0 : e.id) ?? "", g), Y = e && Re(e.kind) ? e.kind : null, Z = Ke(Y, (e == null ? void 0 : e.id) ?? "", l), fe = Ue(Y ?? "function"), ae = _e(Y ?? "function"), [me, f] = u(null), [P, pe] = u(null), [re, X] = u(
1183
+ } = s, v = e == null ? void 0 : e.kind, b = ut(v === "endpoint"), m = xe(v === "function"), [C, k] = u(!1), [D, O] = u(""), [E, M] = u(null), [y, R] = u(null), [Q, N] = u(!1), [g, A] = u(!1), [q, U] = u(!1), [W, $] = u(!1), [oe, z] = u(!1), [le, F] = u(null), [_, te] = u(null), de = Ge((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "function"), ke = Ye((e == null ? void 0 : e.id) ?? "", (e == null ? void 0 : e.kind) === "endpoint"), G = Ze(), ie = Xe(), ce = ht(), se = ft(), ue = mt(), T = pt(), he = e ? We(e.kind) : null, H = Be(he, (e == null ? void 0 : e.id) ?? "", g), Y = e && Re(e.kind) ? e.kind : null, Z = Ke(Y, (e == null ? void 0 : e.id) ?? "", l), fe = Ue(Y ?? "function"), ae = ze(Y ?? "function"), [me, f] = u(null), [P, pe] = u(null), [re, X] = u(
1184
1184
  null
1185
1185
  );
1186
1186
  if (!e || e.kind !== "function" && e.kind !== "endpoint")
1187
1187
  return /* @__PURE__ */ n("p", { className: "muted small", children: "Open a workflow, function, or endpoint to see its settings." });
1188
- const S = e.kind, T = e.id, L = S === "function" ? (Pe = m.data) == null ? void 0 : Pe.find((p) => p.id === T) : (Ie = b.data) == null ? void 0 : Ie.find((p) => p.id === T), J = ze(S, S === "function" ? de.data : ke.data), x = (J == null ? void 0 : J.definition) ?? null, Ee = L && typeof L.displayName == "string" ? L.displayName : "", bn = x ? JSON.stringify(x, null, 2) : "";
1188
+ const S = e.kind, I = e.id, L = S === "function" ? (Pe = m.data) == null ? void 0 : Pe.find((p) => p.id === I) : (Te = b.data) == null ? void 0 : Te.find((p) => p.id === I), J = _e(S, S === "function" ? de.data : ke.data), x = (J == null ? void 0 : J.definition) ?? null, Ee = L && typeof L.displayName == "string" ? L.displayName : "", bn = x ? JSON.stringify(x, null, 2) : "";
1189
1189
  function yn() {
1190
1190
  M(null), O(bn), R((J == null ? void 0 : J.updatedAt) ?? null), k(!0);
1191
1191
  }
@@ -1210,26 +1210,26 @@ function ei({
1210
1210
  $(!1), F(w instanceof j ? w.message : String(w));
1211
1211
  }
1212
1212
  };
1213
- S === "function" ? ce.mutate(T, p) : se.mutate(T, p);
1213
+ S === "function" ? ce.mutate(I, p) : se.mutate(I, p);
1214
1214
  }
1215
1215
  function Sn() {
1216
1216
  te(null);
1217
1217
  const p = {
1218
1218
  onSuccess: () => {
1219
- _(!1), i({ type: "list" });
1219
+ z(!1), i({ type: "list" });
1220
1220
  },
1221
1221
  onError: (w) => {
1222
- _(!1), te(w instanceof j ? w.message : String(w));
1222
+ z(!1), te(w instanceof j ? w.message : String(w));
1223
1223
  }
1224
1224
  };
1225
- S === "function" ? ue.mutate(T, p) : I.mutate(T, p);
1225
+ S === "function" ? ue.mutate(I, p) : T.mutate(I, p);
1226
1226
  }
1227
1227
  return /* @__PURE__ */ r("div", { className: "rail-settings-panel", children: [
1228
1228
  /* @__PURE__ */ n(cn, { onEdit: () => o(!0) }),
1229
1229
  /* @__PURE__ */ n(
1230
1230
  un,
1231
1231
  {
1232
- id: T,
1232
+ id: I,
1233
1233
  displayName: Ee,
1234
1234
  fields: $e(S),
1235
1235
  row: L
@@ -1249,14 +1249,14 @@ function ei({
1249
1249
  d(!0), c(!0);
1250
1250
  },
1251
1251
  onPublish: () => {
1252
- f(null), fe.mutate(T, {
1252
+ f(null), fe.mutate(I, {
1253
1253
  onError: (p) => f(p instanceof j ? p.message : String(p))
1254
1254
  });
1255
1255
  },
1256
1256
  onToggleEnabled: () => {
1257
1257
  var p;
1258
1258
  pe(null), ae.mutate(
1259
- { id: T, enabled: !((p = Z.data) != null && p.enabled) },
1259
+ { id: I, enabled: !((p = Z.data) != null && p.enabled) },
1260
1260
  { onError: (w) => pe(w instanceof j ? w.message : String(w)) }
1261
1261
  );
1262
1262
  }
@@ -1266,16 +1266,16 @@ function ei({
1266
1266
  pn,
1267
1267
  {
1268
1268
  loading: Z.isLoading,
1269
- versions: (Te = Z.data) == null ? void 0 : Te.versions,
1270
- onSelect: (p) => X({ id: T, versionNumber: p }),
1269
+ versions: (Ie = Z.data) == null ? void 0 : Ie.versions,
1270
+ onSelect: (p) => X({ id: I, versionNumber: p }),
1271
1271
  onClose: () => c(!1)
1272
1272
  }
1273
1273
  ),
1274
- re && re.id === T && /* @__PURE__ */ n(
1274
+ re && re.id === I && /* @__PURE__ */ n(
1275
1275
  dn,
1276
1276
  {
1277
1277
  kind: S,
1278
- id: T,
1278
+ id: I,
1279
1279
  versionNumber: re.versionNumber,
1280
1280
  onClose: () => X(null)
1281
1281
  }
@@ -1366,7 +1366,7 @@ function ei({
1366
1366
  ln,
1367
1367
  {
1368
1368
  kind: S,
1369
- id: T,
1369
+ id: I,
1370
1370
  initial: {
1371
1371
  displayName: Ee,
1372
1372
  key: L.key ?? null,
@@ -1386,7 +1386,7 @@ function ei({
1386
1386
  },
1387
1387
  onClose: () => o(!1)
1388
1388
  },
1389
- T
1389
+ I
1390
1390
  ),
1391
1391
  An(S) && /* @__PURE__ */ n(
1392
1392
  gn,
@@ -1396,13 +1396,13 @@ function ei({
1396
1396
  deleteConfirming: W,
1397
1397
  archiveConfirming: oe,
1398
1398
  deleteError: le,
1399
- archiveError: z,
1399
+ archiveError: _,
1400
1400
  onRequestDelete: () => $(!0),
1401
- onRequestArchive: () => _(!0),
1401
+ onRequestArchive: () => z(!0),
1402
1402
  onConfirmDelete: Nn,
1403
1403
  onConfirmArchive: Sn,
1404
1404
  onCloseDelete: () => $(!1),
1405
- onCloseArchive: () => _(!1)
1405
+ onCloseArchive: () => z(!1)
1406
1406
  }
1407
1407
  ),
1408
1408
  q && /* @__PURE__ */ n(
@@ -1546,7 +1546,7 @@ function Ce(e) {
1546
1546
  }
1547
1547
  function ri(e, t) {
1548
1548
  if (Ce(e)) return e;
1549
- if (t && t.length > 0) return It(t);
1549
+ if (t && t.length > 0) return Tt(t);
1550
1550
  }
1551
1551
  function oi(e) {
1552
1552
  const t = /* @__PURE__ */ new Map(), i = [...e].sort((s, a) => s.seq - a.seq);
@@ -1767,6 +1767,6 @@ export {
1767
1767
  qi as c,
1768
1768
  Hi as d,
1769
1769
  Ui as e,
1770
- Tt as u
1770
+ It as u
1771
1771
  };
1772
- //# sourceMappingURL=editor-tools-Dn7TgCP4.js.map
1772
+ //# sourceMappingURL=editor-tools-rY9nddqr.js.map