@mulmoclaude/collection-plugin 0.3.0 → 0.4.1

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 (62) hide show
  1. package/dist/core/errorMessage.d.ts +5 -0
  2. package/dist/core/errorMessage.d.ts.map +1 -0
  3. package/dist/core/promptSafety.d.ts +2 -0
  4. package/dist/core/promptSafety.d.ts.map +1 -0
  5. package/dist/core/shortHexId.d.ts +9 -0
  6. package/dist/core/shortHexId.d.ts.map +1 -0
  7. package/dist/core/uiTypes.d.ts +26 -1
  8. package/dist/core/uiTypes.d.ts.map +1 -1
  9. package/dist/index.cjs +45 -126
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.ts +3 -0
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -86
  14. package/dist/index.js.map +1 -1
  15. package/dist/{calendarGrid-DZeLwBj9.cjs → promptSafety-BSO2gdsg.cjs} +184 -1
  16. package/dist/promptSafety-BSO2gdsg.cjs.map +1 -0
  17. package/dist/{calendarGrid-ggmFTZju.js → promptSafety-DShN_VCG.js} +113 -2
  18. package/dist/promptSafety-DShN_VCG.js.map +1 -0
  19. package/dist/style.css +544 -1
  20. package/dist/vue/collectionViewMode.d.ts +12 -0
  21. package/dist/vue/collectionViewMode.d.ts.map +1 -0
  22. package/dist/vue/components/CollectionCustomView.vue.d.ts +9 -0
  23. package/dist/vue/components/CollectionCustomView.vue.d.ts.map +1 -0
  24. package/dist/vue/components/CollectionEmbedView.vue.d.ts.map +1 -1
  25. package/dist/vue/components/CollectionView.vue.d.ts +41 -0
  26. package/dist/vue/components/CollectionView.vue.d.ts.map +1 -0
  27. package/dist/vue/components/CollectionViewConfigModal.vue.d.ts +16 -0
  28. package/dist/vue/components/CollectionViewConfigModal.vue.d.ts.map +1 -0
  29. package/dist/vue/components/CollectionsIndexView.vue.d.ts +4 -0
  30. package/dist/vue/components/CollectionsIndexView.vue.d.ts.map +1 -0
  31. package/dist/vue/components/FeedsView.vue.d.ts +4 -0
  32. package/dist/vue/components/FeedsView.vue.d.ts.map +1 -0
  33. package/dist/vue/index.d.ts +7 -1
  34. package/dist/vue/index.d.ts.map +1 -1
  35. package/dist/vue/lang/de.d.ts +4 -0
  36. package/dist/vue/lang/de.d.ts.map +1 -0
  37. package/dist/vue/lang/en.d.ts +99 -0
  38. package/dist/vue/lang/en.d.ts.map +1 -0
  39. package/dist/vue/lang/es.d.ts +4 -0
  40. package/dist/vue/lang/es.d.ts.map +1 -0
  41. package/dist/vue/lang/fr.d.ts +4 -0
  42. package/dist/vue/lang/fr.d.ts.map +1 -0
  43. package/dist/vue/lang/index.d.ts +112 -0
  44. package/dist/vue/lang/index.d.ts.map +1 -0
  45. package/dist/vue/lang/ja.d.ts +4 -0
  46. package/dist/vue/lang/ja.d.ts.map +1 -0
  47. package/dist/vue/lang/ko.d.ts +4 -0
  48. package/dist/vue/lang/ko.d.ts.map +1 -0
  49. package/dist/vue/lang/ptBR.d.ts +4 -0
  50. package/dist/vue/lang/ptBR.d.ts.map +1 -0
  51. package/dist/vue/lang/zh.d.ts +4 -0
  52. package/dist/vue/lang/zh.d.ts.map +1 -0
  53. package/dist/vue/uiContext.d.ts +143 -4
  54. package/dist/vue/uiContext.d.ts.map +1 -1
  55. package/dist/vue/useCollectionRendering.d.ts.map +1 -1
  56. package/dist/vue.cjs +3335 -238
  57. package/dist/vue.cjs.map +1 -1
  58. package/dist/vue.js +3305 -217
  59. package/dist/vue.js.map +1 -1
  60. package/package.json +1 -1
  61. package/dist/calendarGrid-DZeLwBj9.cjs.map +0 -1
  62. package/dist/calendarGrid-ggmFTZju.js.map +0 -1
package/dist/vue.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-CKQMccvm.cjs");
3
- const require_calendarGrid = require("./calendarGrid-DZeLwBj9.cjs");
3
+ const require_promptSafety = require("./promptSafety-BSO2gdsg.cjs");
4
4
  const require_deriveAll = require("./deriveAll-BJ0Lvm1Q.cjs");
5
5
  let vue = require("vue");
6
6
  let vue_i18n = require("vue-i18n");
@@ -69,10 +69,20 @@ function useCollectionRendering(collection, locale) {
69
69
  const embedTargets = new Set(uniqueEmbedTargets(schema));
70
70
  const allTargets = [...new Set([...refTargets, ...embedTargets])];
71
71
  if (allTargets.length === 0) return;
72
- const results = await Promise.all(allTargets.map((target) => collectionUi().fetchCollectionDetail(target).then((result) => ({
73
- target,
74
- result
75
- }))));
72
+ const binding = collectionUi();
73
+ const results = await Promise.all(allTargets.map(async (target) => {
74
+ try {
75
+ return {
76
+ target,
77
+ result: await binding.fetchCollectionDetail(target)
78
+ };
79
+ } catch {
80
+ return {
81
+ target,
82
+ result: { ok: false }
83
+ };
84
+ }
85
+ }));
76
86
  if (collection.value?.slug !== expectedSlug) return;
77
87
  const nextRef = {};
78
88
  const nextRefRecords = {};
@@ -259,6 +269,73 @@ function useCollectionRendering(collection, locale) {
259
269
  };
260
270
  }
261
271
  //#endregion
272
+ //#region src/vue/collectionViewMode.ts
273
+ var STORAGE_KEY = "collection_view_modes";
274
+ var SORT_STORAGE_KEY = "collection_sorts";
275
+ var BUILT_IN_MODES = [
276
+ "table",
277
+ "calendar",
278
+ "kanban"
279
+ ];
280
+ /** A persisted mode is valid if it's a known built-in OR any `custom:<id>`
281
+ * key (the id is validated against the live schema at render time, so an
282
+ * unknown custom id simply collapses to the table there). Takes `unknown`
283
+ * and type-guards `string` first: a corrupted localStorage entry could hold a
284
+ * number/object, and calling `.startsWith` on that would throw. */
285
+ function isValidViewMode(value) {
286
+ return typeof value === "string" && (BUILT_IN_MODES.includes(value) || value.startsWith("custom:"));
287
+ }
288
+ function readAll() {
289
+ try {
290
+ const raw = localStorage.getItem(STORAGE_KEY);
291
+ if (!raw) return {};
292
+ const parsed = JSON.parse(raw);
293
+ return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : {};
294
+ } catch {
295
+ return {};
296
+ }
297
+ }
298
+ function readCollectionViewMode(slug) {
299
+ const stored = readAll()[slug];
300
+ return isValidViewMode(stored) ? stored : null;
301
+ }
302
+ function writeCollectionViewMode(slug, view) {
303
+ try {
304
+ const all = readAll();
305
+ all[slug] = view;
306
+ localStorage.setItem(STORAGE_KEY, JSON.stringify(all));
307
+ } catch {}
308
+ }
309
+ function isSortState(value) {
310
+ if (!value || typeof value !== "object") return false;
311
+ const rec = value;
312
+ return typeof rec.field === "string" && (rec.direction === "asc" || rec.direction === "desc");
313
+ }
314
+ function readAllSorts() {
315
+ try {
316
+ const raw = localStorage.getItem(SORT_STORAGE_KEY);
317
+ if (!raw) return {};
318
+ const parsed = JSON.parse(raw);
319
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
320
+ const out = {};
321
+ for (const [slug, value] of Object.entries(parsed)) if (isSortState(value)) out[slug] = value;
322
+ return out;
323
+ } catch {
324
+ return {};
325
+ }
326
+ }
327
+ function readCollectionSort(slug) {
328
+ return readAllSorts()[slug] ?? null;
329
+ }
330
+ /** Persist (or, when `sort` is null, clear) the slug's active column sort. */
331
+ function writeCollectionSort(slug, sort) {
332
+ try {
333
+ const all = Object.fromEntries(Object.entries(readAllSorts()).filter(([key]) => key !== slug));
334
+ if (sort) all[slug] = sort;
335
+ localStorage.setItem(SORT_STORAGE_KEY, JSON.stringify(all));
336
+ } catch {}
337
+ }
338
+ //#endregion
262
339
  //#region src/vue/components/CollectionRecordModal.vue
263
340
  var CollectionRecordModal_default = /* @__PURE__ */ (0, vue.defineComponent)({
264
341
  __name: "CollectionRecordModal",
@@ -329,31 +406,834 @@ var CollectionRecordModal_default = /* @__PURE__ */ (0, vue.defineComponent)({
329
406
  }
330
407
  });
331
408
  //#endregion
409
+ //#region src/vue/lang/index.ts
410
+ var i18n = (0, vue_i18n.createI18n)({
411
+ legacy: false,
412
+ locale: "en",
413
+ fallbackLocale: "en",
414
+ messages: {
415
+ en: {
416
+ collectionsView: {
417
+ addCollectionLabel: "Collection",
418
+ addCollectionPrompt: "Help me create a new collection. First read `config/helps/collection-skills.md` for the schema-driven collection conventions. Then use the `presentForm` tool (do not use AskUserQuestion) to ask me what kind of data I want to track, and author the schema.json and SKILL.md from my answers.",
419
+ addFeedTitle: "Add a feed",
420
+ addFeedHint: "Paste a feed or API URL — I'll fetch it and work out the title and fields for you.",
421
+ addFeedPrompt: "Add a new data-source feed from this URL: {url}\n\nFirst Read `config/helps/feeds.md` and follow it exactly. Fetch that URL yourself, inspect the response to infer a sensible title and fields, then author `feeds/<slug>/schema.json` as the help describes — do NOT ask me any questions; work it all out from the data. Opening the feed loads its items automatically; when you're done, tell me it's registered (no need to mention Refresh).",
422
+ title: "Collections",
423
+ backToIndex: "Back to collections",
424
+ indexEmpty: "No collections installed. Star a skill that ships a schema from the Skills page to see it here.",
425
+ editItem: "Edit",
426
+ openItem: "Open {id}",
427
+ confirmDelete: "Delete this item? This cannot be undone.",
428
+ deleteFeed: "Delete feed",
429
+ confirmDeleteFeed: "Delete the \"{title}\" feed and all its fetched records? This cannot be undone.",
430
+ deleteCollection: "Delete collection",
431
+ confirmDeleteCollection: "Delete the entire \"{title}\" collection, including all its records? A restorable backup is archived first.",
432
+ itemsEmpty: "No items yet. Click + to add one.",
433
+ notFound: "Collection not found",
434
+ loadFailed: "Failed to load",
435
+ requiredField: "This field is required",
436
+ selectPlaceholder: "Select…",
437
+ inlineSaveFailed: "Couldn't save change: {error}",
438
+ addRow: "Add row",
439
+ removeRow: "Remove row",
440
+ noRows: "No rows yet",
441
+ tableSummary: "{count} items",
442
+ embedMissing: "No “{id}” record found in {collection}.",
443
+ embedCreate: "Set it up",
444
+ searchPlaceholder: "Search records…",
445
+ searchSummary: "Showing {shown} of {total}",
446
+ noMatchingItems: "No matching items",
447
+ clearSearch: "Clear search",
448
+ sortBy: "Sort by {field}",
449
+ openCollection: "Open {title}",
450
+ createTitle: "Add new",
451
+ derivedLabel: "Derived",
452
+ embedMissingTitle: "Embedded reference missing",
453
+ chat: "Chat",
454
+ refreshFeed: "Refresh",
455
+ refreshFailed: "Refresh failed: {error}",
456
+ feedChatSeed: "The \"{slug}\" feed is defined by the schema at `feeds/{slug}/schema.json` and its records live in `{dataPath}/` (one `<id>.json` per record). Using that schema and data, respond to this request: {message}",
457
+ feedsTitle: "Data-source feeds",
458
+ feedsEmpty: "No feeds registered yet.",
459
+ chatTitle: "Start a chat",
460
+ chatPlaceholder: "Describe what you want to do with this collection…",
461
+ chatStart: "Start chat",
462
+ viewToggle: "View",
463
+ viewTable: "Table",
464
+ viewCalendar: "Calendar",
465
+ calendarFieldLabel: "Calendar date field",
466
+ calendarPrevMonth: "Previous month",
467
+ calendarNextMonth: "Next month",
468
+ calendarToday: "Today",
469
+ calendarNoDate: "No date",
470
+ calendarCreateOn: "Create on {date}",
471
+ dayViewOpen: "Open day view for {date}",
472
+ dayViewAllDay: "All day",
473
+ dayViewEmpty: "No items on this day",
474
+ dayViewClose: "Close day view",
475
+ viewKanban: "Kanban",
476
+ kanbanFieldLabel: "Kanban group field",
477
+ kanbanUncategorized: "Uncategorized",
478
+ kanbanOpenCard: "Open {label}",
479
+ addView: "Add view",
480
+ config: {
481
+ open: "Collection settings",
482
+ title: "{title} · settings",
483
+ viewsHeading: "Custom views",
484
+ deleteView: "Delete {label}",
485
+ confirmDelete: "Delete the \"{label}\" view? This removes its HTML file and unregisters it.",
486
+ empty: "No custom views yet."
487
+ },
488
+ customViewLoading: "Loading view…",
489
+ customViewError: "Couldn't load this view: {error}",
490
+ addViewPrompt: "I want to add a custom view to the \"{title}\" collection. Ask me what I want to see or edit, then author the HTML view file at {base}/views/your-view.html and register it in {base}/schema.json under `views[]` (capabilities [\"read\"] for a read-only view, [\"read\",\"write\"] if it edits records). Follow the custom-view help for the data contract.",
491
+ repair: "Repair",
492
+ dataIssuesDetected: "{count} record file(s) have data problems and may be missing from this view.",
493
+ repairPrompt: "The \"{title}\" collection has {count} record file(s) with data problems that keep them from appearing. Fix each one — Read the file, correct it, then Write it back:\n{issues}\n\nWhen you're done, call presentCollection to confirm the records load.",
494
+ source: {
495
+ user: "User",
496
+ project: "Project"
497
+ }
498
+ },
499
+ common: {
500
+ close: "Close",
501
+ add: "Add",
502
+ cancel: "Cancel",
503
+ loading: "Loading...",
504
+ no: "No",
505
+ remove: "Remove",
506
+ save: "Save",
507
+ saving: "Saving...",
508
+ yes: "Yes"
509
+ }
510
+ },
511
+ ja: {
512
+ collectionsView: {
513
+ addCollectionLabel: "コレクション",
514
+ addCollectionPrompt: "新しいコレクションを作成したいです。まず `config/helps/collection-skills.md` を読んでスキーマ駆動コレクションの規約を確認してください。次に `presentForm` ツールを使って(AskUserQuestion は使わないで)どんなデータを管理したいか質問し、その回答をもとに schema.json と SKILL.md を作成してください。",
515
+ addFeedTitle: "フィードを追加",
516
+ addFeedHint: "フィードまたは API の URL を貼り付けてください。取得してタイトルとフィールドを自動で判断します。",
517
+ addFeedPrompt: "次の URL からデータソースフィードを追加してください: {url}\n\nまず `config/helps/feeds.md` を読み、その指示に正確に従ってください。その URL を自分で取得してレスポンスを調べ、ふさわしいタイトルとフィールドを推測し、ヘルプの説明どおりに `feeds/<slug>/schema.json` を作成してください。私には質問せず、データからすべて判断してください。フィードを開くとアイテムは自動で読み込まれます。完了したら登録できたことを伝えてください(Refresh を押すよう案内する必要はありません)。",
518
+ title: "コレクション",
519
+ backToIndex: "コレクション一覧に戻る",
520
+ indexEmpty: "インストール済みのコレクションがありません。スキーマを含むスキルを Skills ページからスター付けすると、ここに表示されます。",
521
+ editItem: "編集",
522
+ openItem: "{id} を開く",
523
+ confirmDelete: "この項目を削除しますか?元に戻せません。",
524
+ deleteFeed: "フィードを削除",
525
+ confirmDeleteFeed: "フィード「{title}」と取得済みのすべてのレコードを削除しますか?この操作は取り消せません。",
526
+ deleteCollection: "コレクションを削除",
527
+ confirmDeleteCollection: "コレクション「{title}」とそのすべてのレコードを削除しますか?削除前に復元可能なバックアップが保存されます。",
528
+ itemsEmpty: "まだ項目がありません。+ を押して追加してください。",
529
+ notFound: "コレクションが見つかりません",
530
+ loadFailed: "読み込みに失敗しました",
531
+ requiredField: "この項目は必須です",
532
+ selectPlaceholder: "選択…",
533
+ inlineSaveFailed: "変更を保存できませんでした: {error}",
534
+ addRow: "行を追加",
535
+ removeRow: "行を削除",
536
+ noRows: "行がありません",
537
+ tableSummary: "{count}件",
538
+ embedMissing: "{collection} に「{id}」のレコードが見つかりません。",
539
+ embedCreate: "設定する",
540
+ searchPlaceholder: "レコードを検索…",
541
+ searchSummary: "{total} 件中 {shown} 件を表示",
542
+ noMatchingItems: "一致する項目がありません",
543
+ clearSearch: "検索をクリア",
544
+ sortBy: "{field}で並べ替え",
545
+ openCollection: "{title} を開く",
546
+ createTitle: "新規追加",
547
+ derivedLabel: "計算値",
548
+ embedMissingTitle: "埋め込み参照が見つかりません",
549
+ chat: "チャット",
550
+ refreshFeed: "更新",
551
+ refreshFailed: "更新に失敗しました: {error}",
552
+ feedChatSeed: "フィード「{slug}」はスキーマ `feeds/{slug}/schema.json` で定義され、レコードは `{dataPath}/`(1 レコードにつき `<id>.json` 1 ファイル)に保存されています。このスキーマとデータを使って、次のリクエストに応えてください: {message}",
553
+ feedsTitle: "データソースフィード",
554
+ feedsEmpty: "登録されたフィードはありません。",
555
+ chatTitle: "チャットを開始",
556
+ chatPlaceholder: "このコレクションで行いたいことを入力してください…",
557
+ chatStart: "チャットを開始",
558
+ viewToggle: "表示",
559
+ viewTable: "テーブル",
560
+ viewCalendar: "カレンダー",
561
+ calendarFieldLabel: "カレンダーの日付フィールド",
562
+ calendarPrevMonth: "前の月",
563
+ calendarNextMonth: "次の月",
564
+ calendarToday: "今日",
565
+ calendarNoDate: "日付なし",
566
+ calendarCreateOn: "{date} に作成",
567
+ dayViewOpen: "{date} の日表示を開く",
568
+ dayViewAllDay: "終日",
569
+ dayViewEmpty: "この日の項目はありません",
570
+ dayViewClose: "日表示を閉じる",
571
+ viewKanban: "カンバン",
572
+ kanbanFieldLabel: "カンバンのグループフィールド",
573
+ kanbanUncategorized: "未分類",
574
+ kanbanOpenCard: "{label} を開く",
575
+ addView: "ビューを追加",
576
+ config: {
577
+ open: "コレクション設定",
578
+ title: "{title} · 設定",
579
+ viewsHeading: "カスタムビュー",
580
+ deleteView: "{label} を削除",
581
+ confirmDelete: "ビュー「{label}」を削除しますか? HTML ファイルを削除し、登録を解除します。",
582
+ empty: "カスタムビューはまだありません。"
583
+ },
584
+ customViewLoading: "ビューを読み込み中…",
585
+ customViewError: "このビューを読み込めませんでした: {error}",
586
+ addViewPrompt: "「{title}」コレクションにカスタムビューを追加したい。何を見たい/編集したいか質問してから、HTML ビューファイルを {base}/views/your-view.html に作成し、{base}/schema.json の `views[]` に登録して(読み取り専用なら capabilities [\"read\"]、レコードを編集するなら [\"read\",\"write\"])。データ契約は custom-view ヘルプに従ってください。",
587
+ repair: "修復",
588
+ dataIssuesDetected: "{count} 件のレコードファイルにデータの問題があり、この表示に出てこない可能性があります。",
589
+ repairPrompt: "コレクション「{title}」に、表示されない原因となるデータの問題を持つレコードファイルが {count} 件あります。それぞれを修正してください — ファイルを Read し、修正してから Write し直します:\n{issues}\n\n完了したら presentCollection を呼び出して、レコードが読み込めることを確認してください。",
590
+ source: {
591
+ user: "ユーザー",
592
+ project: "プロジェクト"
593
+ }
594
+ },
595
+ common: {
596
+ close: "閉じる",
597
+ add: "追加",
598
+ cancel: "キャンセル",
599
+ loading: "読み込み中...",
600
+ no: "いいえ",
601
+ remove: "削除",
602
+ save: "保存",
603
+ saving: "保存中...",
604
+ yes: "はい"
605
+ }
606
+ },
607
+ zh: {
608
+ collectionsView: {
609
+ addCollectionLabel: "集合",
610
+ addCollectionPrompt: "帮我创建一个新的集合。请先阅读 `config/helps/collection-skills.md` 了解基于 schema 的集合约定。然后使用 `presentForm` 工具(不要使用 AskUserQuestion)询问我想跟踪哪种数据,并根据我的回答编写 schema.json 和 SKILL.md。",
611
+ addFeedTitle: "添加订阅源",
612
+ addFeedHint: "粘贴订阅源或 API 的 URL,我会抓取并自动推断标题和字段。",
613
+ addFeedPrompt: "从以下 URL 添加一个数据源订阅:{url}\n\n请先阅读 `config/helps/feeds.md` 并严格按其说明操作。自己抓取该 URL 并检查响应,推断合适的标题和字段,然后按帮助说明编写 `feeds/<slug>/schema.json`。不要向我提问——完全根据数据判断。打开订阅源会自动加载条目。完成后告诉我已注册(无需提示点击 Refresh)。",
614
+ title: "集合",
615
+ backToIndex: "返回集合列表",
616
+ indexEmpty: "尚未安装任何集合。在「技能」页面对带有 schema 的技能加星即可在此显示。",
617
+ editItem: "编辑",
618
+ openItem: "打开 {id}",
619
+ confirmDelete: "删除此项?此操作无法撤销。",
620
+ deleteFeed: "删除订阅源",
621
+ confirmDeleteFeed: "删除订阅源「{title}」及其所有已抓取的记录?此操作无法撤销。",
622
+ deleteCollection: "删除集合",
623
+ confirmDeleteCollection: "删除整个“{title}”集合及其所有记录?删除前会先归档一份可恢复的备份。",
624
+ itemsEmpty: "暂无项目。点击 + 添加一个。",
625
+ notFound: "未找到集合",
626
+ loadFailed: "加载失败",
627
+ requiredField: "此字段为必填项",
628
+ selectPlaceholder: "请选择…",
629
+ inlineSaveFailed: "无法保存更改:{error}",
630
+ addRow: "添加行",
631
+ removeRow: "删除行",
632
+ noRows: "暂无行",
633
+ tableSummary: "{count} 项",
634
+ embedMissing: "在 {collection} 中找不到「{id}」记录。",
635
+ embedCreate: "去设置",
636
+ searchPlaceholder: "搜索记录…",
637
+ searchSummary: "显示 {total} 条中的 {shown} 条",
638
+ noMatchingItems: "没有匹配的项目",
639
+ clearSearch: "清除搜索",
640
+ sortBy: "按{field}排序",
641
+ openCollection: "打开 {title}",
642
+ createTitle: "新增",
643
+ derivedLabel: "派生",
644
+ embedMissingTitle: "缺少嵌入引用",
645
+ chat: "对话",
646
+ refreshFeed: "刷新",
647
+ refreshFailed: "刷新失败:{error}",
648
+ feedChatSeed: "订阅源“{slug}”由 schema `feeds/{slug}/schema.json` 定义,其记录保存在 `{dataPath}/`(每条记录一个 `<id>.json` 文件)。请使用该 schema 和数据来响应以下请求:{message}",
649
+ feedsTitle: "数据源订阅",
650
+ feedsEmpty: "尚未注册任何订阅源。",
651
+ chatTitle: "开始对话",
652
+ chatPlaceholder: "描述你想对这个集合做什么…",
653
+ chatStart: "开始对话",
654
+ viewToggle: "视图",
655
+ viewTable: "表格",
656
+ viewCalendar: "日历",
657
+ calendarFieldLabel: "日历日期字段",
658
+ calendarPrevMonth: "上个月",
659
+ calendarNextMonth: "下个月",
660
+ calendarToday: "今天",
661
+ calendarNoDate: "无日期",
662
+ calendarCreateOn: "在 {date} 创建",
663
+ dayViewOpen: "打开 {date} 的日视图",
664
+ dayViewAllDay: "全天",
665
+ dayViewEmpty: "当天没有项目",
666
+ dayViewClose: "关闭日视图",
667
+ viewKanban: "看板",
668
+ kanbanFieldLabel: "看板分组字段",
669
+ kanbanUncategorized: "未分类",
670
+ kanbanOpenCard: "打开 {label}",
671
+ addView: "添加视图",
672
+ config: {
673
+ open: "集合设置",
674
+ title: "{title} · 设置",
675
+ viewsHeading: "自定义视图",
676
+ deleteView: "删除 {label}",
677
+ confirmDelete: "删除视图“{label}”?这将删除其 HTML 文件并取消注册。",
678
+ empty: "暂无自定义视图。"
679
+ },
680
+ customViewLoading: "正在加载视图…",
681
+ customViewError: "无法加载此视图:{error}",
682
+ addViewPrompt: "我想为“{title}”集合添加一个自定义视图。先问我想查看或编辑什么,然后在 {base}/views/your-view.html 创建 HTML 视图文件,并在 {base}/schema.json 的 `views[]` 中注册(只读视图用 capabilities [\"read\"],需要编辑记录则用 [\"read\",\"write\"])。数据契约请遵循 custom-view 帮助文档。",
683
+ repair: "修复",
684
+ dataIssuesDetected: "有 {count} 个记录文件存在数据问题,可能未显示在此视图中。",
685
+ repairPrompt: "集合 {title} 有 {count} 个记录文件存在导致无法显示的数据问题。请逐一修复——用 Read 读取该文件,更正后再用 Write 写回:\n{issues}\n\n完成后,调用 presentCollection 确认记录可以正常加载。",
686
+ source: {
687
+ user: "用户",
688
+ project: "项目"
689
+ }
690
+ },
691
+ common: {
692
+ close: "关闭",
693
+ add: "添加",
694
+ cancel: "取消",
695
+ loading: "加载中...",
696
+ no: "否",
697
+ remove: "移除",
698
+ save: "保存",
699
+ saving: "保存中...",
700
+ yes: "是"
701
+ }
702
+ },
703
+ ko: {
704
+ collectionsView: {
705
+ addCollectionLabel: "컬렉션",
706
+ addCollectionPrompt: "새 컬렉션을 만들고 싶어요. 먼저 `config/helps/collection-skills.md`를 읽고 스키마 기반 컬렉션 규칙을 확인하세요. 그런 다음 `presentForm` 도구를 사용해(AskUserQuestion은 사용하지 말고) 어떤 데이터를 관리하고 싶은지 물어보고, 제 답변을 바탕으로 schema.json과 SKILL.md를 작성해 주세요.",
707
+ addFeedTitle: "피드 추가",
708
+ addFeedHint: "피드 또는 API URL을 붙여넣으세요. 가져와서 제목과 필드를 자동으로 추론합니다.",
709
+ addFeedPrompt: "다음 URL에서 데이터 소스 피드를 추가하세요: {url}\n\n먼저 `config/helps/feeds.md`를 읽고 그대로 따르세요. 해당 URL을 직접 가져와 응답을 살펴보고 적절한 제목과 필드를 추론한 다음, 도움말 설명대로 `feeds/<slug>/schema.json`을 작성하세요. 저에게 질문하지 말고 데이터에서 모두 판단하세요. 피드를 열면 항목이 자동으로 로드됩니다. 완료되면 등록되었다고 알려주세요(Refresh를 누르라고 안내할 필요 없음).",
710
+ title: "컬렉션",
711
+ backToIndex: "컬렉션 목록으로 돌아가기",
712
+ indexEmpty: "설치된 컬렉션이 없습니다. Skills 페이지에서 스키마를 포함한 스킬에 별표를 추가하면 여기에 표시됩니다.",
713
+ editItem: "편집",
714
+ openItem: "{id} 열기",
715
+ confirmDelete: "이 항목을 삭제하시겠습니까? 되돌릴 수 없습니다.",
716
+ deleteFeed: "피드 삭제",
717
+ confirmDeleteFeed: "\"{title}\" 피드와 가져온 모든 레코드를 삭제하시겠습니까? 이 작업은 되돌릴 수 없습니다.",
718
+ deleteCollection: "컬렉션 삭제",
719
+ confirmDeleteCollection: "\"{title}\" 컬렉션과 모든 레코드를 삭제하시겠습니까? 삭제 전에 복원 가능한 백업이 보관됩니다.",
720
+ itemsEmpty: "아직 항목이 없습니다. + 를 눌러 추가하세요.",
721
+ notFound: "컬렉션을 찾을 수 없습니다",
722
+ loadFailed: "불러오기에 실패했습니다",
723
+ requiredField: "이 필드는 필수입니다",
724
+ selectPlaceholder: "선택…",
725
+ inlineSaveFailed: "변경 사항을 저장하지 못했습니다: {error}",
726
+ addRow: "행 추가",
727
+ removeRow: "행 삭제",
728
+ noRows: "행이 없습니다",
729
+ tableSummary: "{count}개",
730
+ embedMissing: "{collection}에 '{id}' 레코드가 없습니다.",
731
+ embedCreate: "설정하기",
732
+ searchPlaceholder: "레코드 검색…",
733
+ searchSummary: "{total}개 중 {shown}개 표시",
734
+ noMatchingItems: "일치하는 항목이 없습니다",
735
+ clearSearch: "검색 지우기",
736
+ sortBy: "{field} 기준 정렬",
737
+ openCollection: "{title} 열기",
738
+ createTitle: "새로 추가",
739
+ derivedLabel: "파생",
740
+ embedMissingTitle: "임베드된 참조 없음",
741
+ chat: "채팅",
742
+ refreshFeed: "새로고침",
743
+ refreshFailed: "새로고침 실패: {error}",
744
+ feedChatSeed: "“{slug}” 피드는 스키마 `feeds/{slug}/schema.json`로 정의되며, 레코드는 `{dataPath}/`(레코드당 `<id>.json` 파일 하나)에 저장됩니다. 이 스키마와 데이터를 사용하여 다음 요청에 응답하세요: {message}",
745
+ feedsTitle: "데이터 소스 피드",
746
+ feedsEmpty: "등록된 피드가 없습니다.",
747
+ chatTitle: "채팅 시작",
748
+ chatPlaceholder: "이 컬렉션으로 하고 싶은 작업을 설명하세요…",
749
+ chatStart: "채팅 시작",
750
+ viewToggle: "보기",
751
+ viewTable: "표",
752
+ viewCalendar: "캘린더",
753
+ calendarFieldLabel: "캘린더 날짜 필드",
754
+ calendarPrevMonth: "이전 달",
755
+ calendarNextMonth: "다음 달",
756
+ calendarToday: "오늘",
757
+ calendarNoDate: "날짜 없음",
758
+ calendarCreateOn: "{date}에 생성",
759
+ dayViewOpen: "{date} 일 보기 열기",
760
+ dayViewAllDay: "종일",
761
+ dayViewEmpty: "이 날에는 항목이 없습니다",
762
+ dayViewClose: "일 보기 닫기",
763
+ viewKanban: "칸반",
764
+ kanbanFieldLabel: "칸반 그룹 필드",
765
+ kanbanUncategorized: "미분류",
766
+ kanbanOpenCard: "{label} 열기",
767
+ addView: "보기 추가",
768
+ config: {
769
+ open: "컬렉션 설정",
770
+ title: "{title} · 설정",
771
+ viewsHeading: "사용자 지정 보기",
772
+ deleteView: "{label} 삭제",
773
+ confirmDelete: "“{label}” 보기를 삭제할까요? HTML 파일을 삭제하고 등록을 해제합니다.",
774
+ empty: "아직 사용자 지정 보기가 없습니다."
775
+ },
776
+ customViewLoading: "보기를 불러오는 중…",
777
+ customViewError: "이 보기를 불러오지 못했습니다: {error}",
778
+ addViewPrompt: "{title} 컬렉션에 사용자 지정 보기를 추가하고 싶어요. 무엇을 보거나 편집하고 싶은지 먼저 물어본 뒤, {base}/views/your-view.html 에 HTML 보기 파일을 만들고 {base}/schema.json의 `views[]`에 등록해 주세요(읽기 전용 보기는 capabilities [\"read\"], 레코드를 편집하면 [\"read\",\"write\"]). 데이터 계약은 custom-view 도움말을 따르세요.",
779
+ repair: "복구",
780
+ dataIssuesDetected: "{count}개의 레코드 파일에 데이터 문제가 있어 이 보기에 표시되지 않을 수 있습니다.",
781
+ repairPrompt: "{title} 컬렉션에 표시되지 않는 원인이 되는 데이터 문제가 있는 레코드 파일이 {count}개 있습니다. 각 파일을 수정하세요 — Read로 파일을 읽고 수정한 뒤 Write로 다시 저장하세요:\n{issues}\n\n완료되면 presentCollection을 호출하여 레코드가 로드되는지 확인하세요.",
782
+ source: {
783
+ user: "사용자",
784
+ project: "프로젝트"
785
+ }
786
+ },
787
+ common: {
788
+ close: "닫기",
789
+ add: "추가",
790
+ cancel: "취소",
791
+ loading: "불러오는 중...",
792
+ no: "아니오",
793
+ remove: "삭제",
794
+ save: "저장",
795
+ saving: "저장 중...",
796
+ yes: "예"
797
+ }
798
+ },
799
+ es: {
800
+ collectionsView: {
801
+ addCollectionLabel: "Colección",
802
+ addCollectionPrompt: "Ayúdame a crear una nueva colección. Primero lee `config/helps/collection-skills.md` para conocer las convenciones de las colecciones basadas en esquemas. Luego usa la herramienta `presentForm` (no uses AskUserQuestion) para preguntarme qué tipo de datos quiero registrar, y crea el schema.json y el SKILL.md a partir de mis respuestas.",
803
+ addFeedTitle: "Añadir un feed",
804
+ addFeedHint: "Pega la URL de un feed o una API; la obtendré y deduciré el título y los campos por ti.",
805
+ addFeedPrompt: "Añade una nueva fuente de datos (feed) desde esta URL: {url}\n\nPrimero lee `config/helps/feeds.md` y síguelo exactamente. Obtén esa URL tú mismo, inspecciona la respuesta para deducir un título adecuado y los campos, y luego crea `feeds/<slug>/schema.json` como indica la ayuda. NO me hagas preguntas: dedúcelo todo a partir de los datos. Al abrir el feed sus elementos se cargan automáticamente; cuando termines, dime que está registrado (no hace falta mencionar Refresh).",
806
+ title: "Colecciones",
807
+ backToIndex: "Volver a colecciones",
808
+ indexEmpty: "No hay colecciones instaladas. Marca con estrella una skill que incluya un schema desde la página Skills para verla aquí.",
809
+ editItem: "Editar",
810
+ openItem: "Abrir {id}",
811
+ confirmDelete: "¿Eliminar este elemento? Esta acción no se puede deshacer.",
812
+ deleteFeed: "Eliminar feed",
813
+ confirmDeleteFeed: "¿Eliminar el feed \"{title}\" y todos sus registros descargados? Esta acción no se puede deshacer.",
814
+ deleteCollection: "Eliminar colección",
815
+ confirmDeleteCollection: "¿Eliminar toda la colección \"{title}\", incluidos todos sus registros? Antes se archiva una copia de seguridad restaurable.",
816
+ itemsEmpty: "Aún no hay elementos. Pulsa + para añadir uno.",
817
+ notFound: "Colección no encontrada",
818
+ loadFailed: "Error al cargar",
819
+ requiredField: "Este campo es obligatorio",
820
+ selectPlaceholder: "Seleccionar…",
821
+ inlineSaveFailed: "No se pudo guardar el cambio: {error}",
822
+ addRow: "Añadir fila",
823
+ removeRow: "Quitar fila",
824
+ noRows: "Aún no hay filas",
825
+ tableSummary: "{count} elementos",
826
+ embedMissing: "No se encontró el registro «{id}» en {collection}.",
827
+ embedCreate: "Configurarlo",
828
+ searchPlaceholder: "Buscar registros…",
829
+ searchSummary: "Mostrando {shown} de {total}",
830
+ noMatchingItems: "No hay elementos coincidentes",
831
+ clearSearch: "Borrar búsqueda",
832
+ sortBy: "Ordenar por {field}",
833
+ openCollection: "Abrir {title}",
834
+ createTitle: "Añadir nuevo",
835
+ derivedLabel: "Derivado",
836
+ embedMissingTitle: "Falta la referencia incrustada",
837
+ chat: "Chat",
838
+ refreshFeed: "Actualizar",
839
+ refreshFailed: "Error al actualizar: {error}",
840
+ feedChatSeed: "El feed «{slug}» está definido por el esquema `feeds/{slug}/schema.json` y sus registros se guardan en `{dataPath}/` (un archivo `<id>.json` por registro). Usa ese esquema y esos datos para responder a esta solicitud: {message}",
841
+ feedsTitle: "Fuentes de datos",
842
+ feedsEmpty: "Aún no hay fuentes registradas.",
843
+ chatTitle: "Iniciar un chat",
844
+ chatPlaceholder: "Describe qué quieres hacer con esta colección…",
845
+ chatStart: "Iniciar chat",
846
+ viewToggle: "Vista",
847
+ viewTable: "Tabla",
848
+ viewCalendar: "Calendario",
849
+ calendarFieldLabel: "Campo de fecha del calendario",
850
+ calendarPrevMonth: "Mes anterior",
851
+ calendarNextMonth: "Mes siguiente",
852
+ calendarToday: "Hoy",
853
+ calendarNoDate: "Sin fecha",
854
+ calendarCreateOn: "Crear el {date}",
855
+ dayViewOpen: "Abrir vista de día para {date}",
856
+ dayViewAllDay: "Todo el día",
857
+ dayViewEmpty: "No hay elementos este día",
858
+ dayViewClose: "Cerrar vista de día",
859
+ viewKanban: "Kanban",
860
+ kanbanFieldLabel: "Campo de agrupación Kanban",
861
+ kanbanUncategorized: "Sin categoría",
862
+ kanbanOpenCard: "Abrir {label}",
863
+ addView: "Añadir vista",
864
+ config: {
865
+ open: "Ajustes de la colección",
866
+ title: "{title} · ajustes",
867
+ viewsHeading: "Vistas personalizadas",
868
+ deleteView: "Eliminar {label}",
869
+ confirmDelete: "¿Eliminar la vista \"{label}\"? Se borrará su archivo HTML y se anulará su registro.",
870
+ empty: "Aún no hay vistas personalizadas."
871
+ },
872
+ customViewLoading: "Cargando vista…",
873
+ customViewError: "No se pudo cargar esta vista: {error}",
874
+ addViewPrompt: "Quiero añadir una vista personalizada a la colección «{title}». Pregúntame qué quiero ver o editar, luego crea el archivo HTML de la vista en {base}/views/your-view.html y regístralo en {base}/schema.json dentro de `views[]` (capabilities [\"read\"] para una vista de solo lectura, [\"read\",\"write\"] si edita registros). Sigue la ayuda custom-view para el contrato de datos.",
875
+ repair: "Reparar",
876
+ dataIssuesDetected: "{count} archivo(s) de registro tienen problemas de datos y podrían no aparecer en esta vista.",
877
+ repairPrompt: "La colección {title} tiene {count} archivo(s) de registro con problemas de datos que impiden que aparezcan. Corrige cada uno: lee el archivo con Read, corrígelo y vuelve a escribirlo con Write:\n{issues}\n\nCuando termines, llama a presentCollection para confirmar que los registros se cargan.",
878
+ source: {
879
+ user: "Usuario",
880
+ project: "Proyecto"
881
+ }
882
+ },
883
+ common: {
884
+ close: "Cerrar",
885
+ add: "Añadir",
886
+ cancel: "Cancelar",
887
+ loading: "Cargando...",
888
+ no: "No",
889
+ remove: "Quitar",
890
+ save: "Guardar",
891
+ saving: "Guardando...",
892
+ yes: "Sí"
893
+ }
894
+ },
895
+ "pt-BR": {
896
+ collectionsView: {
897
+ addCollectionLabel: "Coleção",
898
+ addCollectionPrompt: "Ajude-me a criar uma nova coleção. Primeiro leia `config/helps/collection-skills.md` para conhecer as convenções de coleções baseadas em esquema. Depois use a ferramenta `presentForm` (não use AskUserQuestion) para perguntar que tipo de dados quero acompanhar, e crie o schema.json e o SKILL.md a partir das minhas respostas.",
899
+ addFeedTitle: "Adicionar um feed",
900
+ addFeedHint: "Cole a URL de um feed ou API; vou buscá-la e deduzir o título e os campos para você.",
901
+ addFeedPrompt: "Adicione um novo feed de fonte de dados a partir desta URL: {url}\n\nPrimeiro leia `config/helps/feeds.md` e siga-o exatamente. Busque essa URL você mesmo, inspecione a resposta para deduzir um título adequado e os campos, e então crie `feeds/<slug>/schema.json` como a ajuda descreve. NÃO me faça perguntas: deduza tudo a partir dos dados. Ao abrir o feed os itens são carregados automaticamente; quando terminar, diga-me que está registrado (não precisa mencionar Refresh).",
902
+ title: "Coleções",
903
+ backToIndex: "Voltar para coleções",
904
+ indexEmpty: "Nenhuma coleção instalada. Marque com estrela uma skill que inclua um schema na página Skills para vê-la aqui.",
905
+ editItem: "Editar",
906
+ openItem: "Abrir {id}",
907
+ confirmDelete: "Excluir este item? Esta ação não pode ser desfeita.",
908
+ deleteFeed: "Excluir feed",
909
+ confirmDeleteFeed: "Excluir o feed \"{title}\" e todos os seus registros baixados? Esta ação não pode ser desfeita.",
910
+ deleteCollection: "Excluir coleção",
911
+ confirmDeleteCollection: "Excluir toda a coleção \"{title}\", incluindo todos os seus registros? Um backup restaurável é arquivado antes.",
912
+ itemsEmpty: "Ainda não há itens. Clique em + para adicionar um.",
913
+ notFound: "Coleção não encontrada",
914
+ loadFailed: "Falha ao carregar",
915
+ requiredField: "Este campo é obrigatório",
916
+ selectPlaceholder: "Selecionar…",
917
+ inlineSaveFailed: "Não foi possível salvar a alteração: {error}",
918
+ addRow: "Adicionar linha",
919
+ removeRow: "Remover linha",
920
+ noRows: "Ainda não há linhas",
921
+ tableSummary: "{count} itens",
922
+ embedMissing: "Nenhum registro '{id}' encontrado em {collection}.",
923
+ embedCreate: "Configurar",
924
+ searchPlaceholder: "Buscar registros…",
925
+ searchSummary: "Mostrando {shown} de {total}",
926
+ noMatchingItems: "Nenhum item correspondente",
927
+ clearSearch: "Limpar busca",
928
+ sortBy: "Ordenar por {field}",
929
+ openCollection: "Abrir {title}",
930
+ createTitle: "Adicionar novo",
931
+ derivedLabel: "Derivado",
932
+ embedMissingTitle: "Referência incorporada ausente",
933
+ chat: "Chat",
934
+ refreshFeed: "Atualizar",
935
+ refreshFailed: "Falha ao atualizar: {error}",
936
+ feedChatSeed: "O feed \"{slug}\" é definido pelo esquema `feeds/{slug}/schema.json` e seus registros ficam em `{dataPath}/` (um arquivo `<id>.json` por registro). Use esse esquema e esses dados para responder a esta solicitação: {message}",
937
+ feedsTitle: "Feeds de dados",
938
+ feedsEmpty: "Nenhum feed registrado ainda.",
939
+ chatTitle: "Iniciar um chat",
940
+ chatPlaceholder: "Descreva o que você quer fazer com esta coleção…",
941
+ chatStart: "Iniciar chat",
942
+ viewToggle: "Visualização",
943
+ viewTable: "Tabela",
944
+ viewCalendar: "Calendário",
945
+ calendarFieldLabel: "Campo de data do calendário",
946
+ calendarPrevMonth: "Mês anterior",
947
+ calendarNextMonth: "Próximo mês",
948
+ calendarToday: "Hoje",
949
+ calendarNoDate: "Sem data",
950
+ calendarCreateOn: "Criar em {date}",
951
+ dayViewOpen: "Abrir visualização do dia para {date}",
952
+ dayViewAllDay: "Dia inteiro",
953
+ dayViewEmpty: "Nenhum item neste dia",
954
+ dayViewClose: "Fechar visualização do dia",
955
+ viewKanban: "Kanban",
956
+ kanbanFieldLabel: "Campo de agrupamento do Kanban",
957
+ kanbanUncategorized: "Sem categoria",
958
+ kanbanOpenCard: "Abrir {label}",
959
+ addView: "Adicionar visualização",
960
+ config: {
961
+ open: "Configurações da coleção",
962
+ title: "{title} · configurações",
963
+ viewsHeading: "Visualizações personalizadas",
964
+ deleteView: "Excluir {label}",
965
+ confirmDelete: "Excluir a visualização \"{label}\"? Isso remove o arquivo HTML e cancela o registro.",
966
+ empty: "Ainda não há visualizações personalizadas."
967
+ },
968
+ customViewLoading: "Carregando visualização…",
969
+ customViewError: "Não foi possível carregar esta visualização: {error}",
970
+ addViewPrompt: "Quero adicionar uma visualização personalizada à coleção \"{title}\". Pergunte o que eu quero ver ou editar, depois crie o arquivo HTML da visualização em {base}/views/your-view.html e registre-o em {base}/schema.json em `views[]` (capabilities [\"read\"] para uma visualização somente leitura, [\"read\",\"write\"] se editar registros). Siga a ajuda custom-view para o contrato de dados.",
971
+ repair: "Reparar",
972
+ dataIssuesDetected: "{count} arquivo(s) de registro têm problemas de dados e podem não aparecer nesta visualização.",
973
+ repairPrompt: "A coleção {title} tem {count} arquivo(s) de registro com problemas de dados que impedem que apareçam. Corrija cada um: leia o arquivo com Read, corrija-o e grave-o novamente com Write:\n{issues}\n\nQuando terminar, chame presentCollection para confirmar que os registros carregam.",
974
+ source: {
975
+ user: "Usuário",
976
+ project: "Projeto"
977
+ }
978
+ },
979
+ common: {
980
+ close: "Fechar",
981
+ add: "Adicionar",
982
+ cancel: "Cancelar",
983
+ loading: "Carregando...",
984
+ no: "Não",
985
+ remove: "Remover",
986
+ save: "Salvar",
987
+ saving: "Salvando...",
988
+ yes: "Sim"
989
+ }
990
+ },
991
+ fr: {
992
+ collectionsView: {
993
+ addCollectionLabel: "Collection",
994
+ addCollectionPrompt: "Aide-moi à créer une nouvelle collection. Lis d'abord `config/helps/collection-skills.md` pour les conventions des collections basées sur un schéma. Utilise ensuite l'outil `presentForm` (n'utilise pas AskUserQuestion) pour me demander quel type de données je veux suivre, et crée le schema.json et le SKILL.md à partir de mes réponses.",
995
+ addFeedTitle: "Ajouter un flux",
996
+ addFeedHint: "Collez l'URL d'un flux ou d'une API ; je la récupère et déduis le titre et les champs pour vous.",
997
+ addFeedPrompt: "Ajoute un nouveau flux de source de données depuis cette URL : {url}\n\nLis d'abord `config/helps/feeds.md` et suis-le exactement. Récupère cette URL toi-même, inspecte la réponse pour déduire un titre pertinent et les champs, puis crée `feeds/<slug>/schema.json` comme l'explique l'aide. Ne me pose AUCUNE question — déduis tout à partir des données. À l'ouverture du flux, ses éléments se chargent automatiquement ; quand tu as terminé, dis-moi qu'il est enregistré (inutile de mentionner Refresh).",
998
+ title: "Collections",
999
+ backToIndex: "Retour aux collections",
1000
+ indexEmpty: "Aucune collection installée. Mettez une étoile sur une compétence avec un schema depuis la page Skills pour la voir ici.",
1001
+ editItem: "Modifier",
1002
+ openItem: "Ouvrir {id}",
1003
+ confirmDelete: "Supprimer cet élément ? Cette action est irréversible.",
1004
+ deleteFeed: "Supprimer le flux",
1005
+ confirmDeleteFeed: "Supprimer le flux « {title} » et tous ses enregistrements récupérés ? Cette action est irréversible.",
1006
+ deleteCollection: "Supprimer la collection",
1007
+ confirmDeleteCollection: "Supprimer toute la collection « {title} », y compris tous ses enregistrements ? Une sauvegarde restaurable est archivée au préalable.",
1008
+ itemsEmpty: "Aucun élément pour l'instant. Cliquez sur + pour en ajouter un.",
1009
+ notFound: "Collection introuvable",
1010
+ loadFailed: "Échec du chargement",
1011
+ requiredField: "Ce champ est obligatoire",
1012
+ selectPlaceholder: "Sélectionner…",
1013
+ inlineSaveFailed: "Impossible d'enregistrer la modification : {error}",
1014
+ addRow: "Ajouter une ligne",
1015
+ removeRow: "Supprimer la ligne",
1016
+ noRows: "Aucune ligne pour l'instant",
1017
+ tableSummary: "{count} éléments",
1018
+ embedMissing: "Aucun enregistrement « {id} » trouvé dans {collection}.",
1019
+ embedCreate: "Le configurer",
1020
+ searchPlaceholder: "Rechercher des enregistrements…",
1021
+ searchSummary: "Affichage de {shown} sur {total}",
1022
+ noMatchingItems: "Aucun élément correspondant",
1023
+ clearSearch: "Effacer la recherche",
1024
+ sortBy: "Trier par {field}",
1025
+ openCollection: "Ouvrir {title}",
1026
+ createTitle: "Ajouter",
1027
+ derivedLabel: "Calculé",
1028
+ embedMissingTitle: "Référence intégrée manquante",
1029
+ chat: "Discussion",
1030
+ refreshFeed: "Actualiser",
1031
+ refreshFailed: "Échec de l'actualisation : {error}",
1032
+ feedChatSeed: "Le flux « {slug} » est défini par le schéma `feeds/{slug}/schema.json` et ses enregistrements se trouvent dans `{dataPath}/` (un fichier `<id>.json` par enregistrement). Utilise ce schéma et ces données pour répondre à cette demande : {message}",
1033
+ feedsTitle: "Flux de données",
1034
+ feedsEmpty: "Aucun flux enregistré pour le moment.",
1035
+ chatTitle: "Démarrer une discussion",
1036
+ chatPlaceholder: "Décrivez ce que vous voulez faire avec cette collection…",
1037
+ chatStart: "Démarrer la discussion",
1038
+ viewToggle: "Affichage",
1039
+ viewTable: "Tableau",
1040
+ viewCalendar: "Calendrier",
1041
+ calendarFieldLabel: "Champ de date du calendrier",
1042
+ calendarPrevMonth: "Mois précédent",
1043
+ calendarNextMonth: "Mois suivant",
1044
+ calendarToday: "Aujourd'hui",
1045
+ calendarNoDate: "Sans date",
1046
+ calendarCreateOn: "Créer le {date}",
1047
+ dayViewOpen: "Ouvrir la vue du jour pour {date}",
1048
+ dayViewAllDay: "Toute la journée",
1049
+ dayViewEmpty: "Aucun élément ce jour",
1050
+ dayViewClose: "Fermer la vue du jour",
1051
+ viewKanban: "Kanban",
1052
+ kanbanFieldLabel: "Champ de regroupement Kanban",
1053
+ kanbanUncategorized: "Non classé",
1054
+ kanbanOpenCard: "Ouvrir {label}",
1055
+ addView: "Ajouter une vue",
1056
+ config: {
1057
+ open: "Paramètres de la collection",
1058
+ title: "{title} · paramètres",
1059
+ viewsHeading: "Vues personnalisées",
1060
+ deleteView: "Supprimer {label}",
1061
+ confirmDelete: "Supprimer la vue « {label} » ? Cela supprime son fichier HTML et la désenregistre.",
1062
+ empty: "Aucune vue personnalisée pour le moment."
1063
+ },
1064
+ customViewLoading: "Chargement de la vue…",
1065
+ customViewError: "Impossible de charger cette vue : {error}",
1066
+ addViewPrompt: "Je veux ajouter une vue personnalisée à la collection « {title} ». Demande-moi ce que je veux voir ou modifier, puis crée le fichier HTML de la vue dans {base}/views/your-view.html et enregistre-le dans {base}/schema.json sous `views[]` (capabilities [\"read\"] pour une vue en lecture seule, [\"read\",\"write\"] si elle modifie des enregistrements). Suis l'aide custom-view pour le contrat de données.",
1067
+ repair: "Réparer",
1068
+ dataIssuesDetected: "{count} fichier(s) d'enregistrement présentent des problèmes de données et peuvent être absents de cette vue.",
1069
+ repairPrompt: "La collection « {title} » comporte {count} fichier(s) d'enregistrement présentant des problèmes de données qui les empêchent d'apparaître. Corrigez chacun : lisez le fichier avec Read, corrigez-le, puis réécrivez-le avec Write :\n{issues}\n\nUne fois terminé, appelez presentCollection pour confirmer que les enregistrements se chargent.",
1070
+ source: {
1071
+ user: "Utilisateur",
1072
+ project: "Projet"
1073
+ }
1074
+ },
1075
+ common: {
1076
+ close: "Fermer",
1077
+ add: "Ajouter",
1078
+ cancel: "Annuler",
1079
+ loading: "Chargement...",
1080
+ no: "Non",
1081
+ remove: "Supprimer",
1082
+ save: "Enregistrer",
1083
+ saving: "Enregistrement...",
1084
+ yes: "Oui"
1085
+ }
1086
+ },
1087
+ de: {
1088
+ collectionsView: {
1089
+ addCollectionLabel: "Sammlung",
1090
+ addCollectionPrompt: "Hilf mir, eine neue Sammlung zu erstellen. Lies zuerst `config/helps/collection-skills.md` für die Konventionen schemabasierter Sammlungen. Verwende dann das Tool `presentForm` (nutze nicht AskUserQuestion), um mich zu fragen, welche Art von Daten ich verfolgen möchte, und erstelle die schema.json und SKILL.md aus meinen Antworten.",
1091
+ addFeedTitle: "Feed hinzufügen",
1092
+ addFeedHint: "Füge die URL eines Feeds oder einer API ein; ich rufe sie ab und ermittle Titel und Felder für dich.",
1093
+ addFeedPrompt: "Füge einen neuen Datenquellen-Feed von dieser URL hinzu: {url}\n\nLies zuerst `config/helps/feeds.md` und befolge es genau. Rufe diese URL selbst ab, untersuche die Antwort, um einen sinnvollen Titel und die Felder abzuleiten, und erstelle dann `feeds/<slug>/schema.json` wie in der Hilfe beschrieben. Stelle mir KEINE Fragen - leite alles aus den Daten ab. Beim Öffnen des Feeds werden seine Einträge automatisch geladen; sag mir Bescheid, wenn er registriert ist (Refresh muss nicht erwähnt werden).",
1094
+ title: "Sammlungen",
1095
+ backToIndex: "Zurück zu Sammlungen",
1096
+ indexEmpty: "Keine Sammlungen installiert. Markiere auf der Skills-Seite eine Skill mit Schema, um sie hier zu sehen.",
1097
+ editItem: "Bearbeiten",
1098
+ openItem: "{id} öffnen",
1099
+ confirmDelete: "Diesen Eintrag löschen? Das kann nicht rückgängig gemacht werden.",
1100
+ deleteFeed: "Feed löschen",
1101
+ confirmDeleteFeed: "Den Feed {title} und alle abgerufenen Datensätze löschen? Dies kann nicht rückgängig gemacht werden.",
1102
+ deleteCollection: "Sammlung löschen",
1103
+ confirmDeleteCollection: "Die gesamte Sammlung „{title}“ einschließlich aller Datensätze löschen? Zuvor wird eine wiederherstellbare Sicherung archiviert.",
1104
+ itemsEmpty: "Noch keine Einträge. Klicke auf +, um einen hinzuzufügen.",
1105
+ notFound: "Sammlung nicht gefunden",
1106
+ loadFailed: "Laden fehlgeschlagen",
1107
+ requiredField: "Dieses Feld ist erforderlich",
1108
+ selectPlaceholder: "Auswählen…",
1109
+ inlineSaveFailed: "Änderung konnte nicht gespeichert werden: {error}",
1110
+ addRow: "Zeile hinzufügen",
1111
+ removeRow: "Zeile entfernen",
1112
+ noRows: "Noch keine Zeilen",
1113
+ tableSummary: "{count} Einträge",
1114
+ embedMissing: "Kein Datensatz {id} in {collection} gefunden.",
1115
+ embedCreate: "Einrichten",
1116
+ searchPlaceholder: "Datensätze suchen…",
1117
+ searchSummary: "{shown} von {total} werden angezeigt",
1118
+ noMatchingItems: "Keine passenden Einträge",
1119
+ clearSearch: "Suche zurücksetzen",
1120
+ sortBy: "Nach {field} sortieren",
1121
+ openCollection: "{title} öffnen",
1122
+ createTitle: "Neu hinzufügen",
1123
+ derivedLabel: "Abgeleitet",
1124
+ embedMissingTitle: "Eingebettete Referenz fehlt",
1125
+ chat: "Chat",
1126
+ refreshFeed: "Aktualisieren",
1127
+ refreshFailed: "Aktualisierung fehlgeschlagen: {error}",
1128
+ feedChatSeed: "Der Feed {slug} ist durch das Schema `feeds/{slug}/schema.json` definiert und seine Datensätze liegen in `{dataPath}/` (eine `<id>.json`-Datei pro Datensatz). Nutze dieses Schema und diese Daten, um auf die folgende Anfrage zu antworten: {message}",
1129
+ feedsTitle: "Datenquellen-Feeds",
1130
+ feedsEmpty: "Noch keine Feeds registriert.",
1131
+ chatTitle: "Chat starten",
1132
+ chatPlaceholder: "Beschreibe, was du mit dieser Sammlung tun möchtest…",
1133
+ chatStart: "Chat starten",
1134
+ viewToggle: "Ansicht",
1135
+ viewTable: "Tabelle",
1136
+ viewCalendar: "Kalender",
1137
+ calendarFieldLabel: "Kalender-Datumsfeld",
1138
+ calendarPrevMonth: "Voriger Monat",
1139
+ calendarNextMonth: "Nächster Monat",
1140
+ calendarToday: "Heute",
1141
+ calendarNoDate: "Kein Datum",
1142
+ calendarCreateOn: "Am {date} erstellen",
1143
+ dayViewOpen: "Tagesansicht für {date} öffnen",
1144
+ dayViewAllDay: "Ganztägig",
1145
+ dayViewEmpty: "Keine Einträge an diesem Tag",
1146
+ dayViewClose: "Tagesansicht schließen",
1147
+ viewKanban: "Kanban",
1148
+ kanbanFieldLabel: "Kanban-Gruppierungsfeld",
1149
+ kanbanUncategorized: "Nicht kategorisiert",
1150
+ kanbanOpenCard: "{label} öffnen",
1151
+ addView: "Ansicht hinzufügen",
1152
+ config: {
1153
+ open: "Sammlungseinstellungen",
1154
+ title: "{title} · Einstellungen",
1155
+ viewsHeading: "Benutzerdefinierte Ansichten",
1156
+ deleteView: "{label} löschen",
1157
+ confirmDelete: "Ansicht {label} löschen? Die HTML-Datei wird entfernt und die Registrierung aufgehoben.",
1158
+ empty: "Noch keine benutzerdefinierten Ansichten."
1159
+ },
1160
+ customViewLoading: "Ansicht wird geladen…",
1161
+ customViewError: "Diese Ansicht konnte nicht geladen werden: {error}",
1162
+ addViewPrompt: "Ich möchte der Sammlung {title} eine benutzerdefinierte Ansicht hinzufügen. Frag mich, was ich sehen oder bearbeiten möchte, erstelle dann die HTML-Ansichtsdatei unter {base}/views/your-view.html und registriere sie in {base}/schema.json unter `views[]` (capabilities [\"read\"] für eine schreibgeschützte Ansicht, [\"read\",\"write\"] wenn sie Datensätze bearbeitet). Folge der custom-view-Hilfe für den Datenvertrag.",
1163
+ repair: "Reparieren",
1164
+ dataIssuesDetected: "{count} Datensatzdatei(en) haben Datenprobleme und fehlen möglicherweise in dieser Ansicht.",
1165
+ repairPrompt: "Die Sammlung {title} hat {count} Datensatzdatei(en) mit Datenproblemen, die ihr Erscheinen verhindern. Korrigiere jede — die Datei mit Read lesen, korrigieren und mit Write zurückschreiben:\n{issues}\n\nRufe anschließend presentCollection auf, um zu bestätigen, dass die Datensätze geladen werden.",
1166
+ source: {
1167
+ user: "Benutzer",
1168
+ project: "Projekt"
1169
+ }
1170
+ },
1171
+ common: {
1172
+ close: "Schließen",
1173
+ add: "Hinzufügen",
1174
+ cancel: "Abbrechen",
1175
+ loading: "Wird geladen...",
1176
+ no: "Nein",
1177
+ remove: "Entfernen",
1178
+ save: "Speichern",
1179
+ saving: "Wird gespeichert...",
1180
+ yes: "Ja"
1181
+ }
1182
+ }
1183
+ }
1184
+ });
1185
+ var syncScope = (0, vue.effectScope)(true);
1186
+ var syncing = false;
1187
+ /** Mirror this instance's locale to the host's (via the binding) exactly once,
1188
+ * in a detached effect so it lives for the app's lifetime rather than a single
1189
+ * component's. Called lazily on the first `useT()` — by then App.vue's setup has
1190
+ * configured the binding, so `collectionUi()` resolves. */
1191
+ function ensureLocaleSync() {
1192
+ if (syncing) return;
1193
+ syncScope.run(() => {
1194
+ (0, vue.watchEffect)(() => {
1195
+ i18n.global.locale.value = collectionUi().localeTag();
1196
+ });
1197
+ });
1198
+ syncing = true;
1199
+ }
1200
+ /** The plugin's i18n composable — a drop-in for vue-i18n's `useI18n()` over the
1201
+ * plugin's own self-contained instance. Returns `{ t, locale }` (destructured at
1202
+ * the call site, exactly like `useI18n()`), with `t` reading the plugin's keys
1203
+ * and `locale` the reactive tag for date/number formatting. */
1204
+ function useCollectionI18n() {
1205
+ ensureLocaleSync();
1206
+ return {
1207
+ t: i18n.global.t,
1208
+ locale: i18n.global.locale
1209
+ };
1210
+ }
1211
+ //#endregion
332
1212
  //#region src/vue/components/CollectionEmbedView.vue?vue&type=script&setup=true&lang.ts
333
- var _hoisted_1$4 = { class: "flex items-center justify-between text-[10px] font-bold text-indigo-600/90 tracking-wider uppercase" };
334
- var _hoisted_2$4 = { class: "flex items-center gap-1.5" };
335
- var _hoisted_3$4 = { class: "bg-indigo-100/60 text-indigo-700 px-1.5 py-0.5 rounded font-mono font-medium lowercase" };
336
- var _hoisted_4$4 = { class: "grid gap-x-4 gap-y-3 grid-cols-2" };
337
- var _hoisted_5$4 = { class: "text-[10px] font-semibold text-slate-400 uppercase tracking-wide" };
338
- var _hoisted_6$4 = ["data-testid"];
339
- var _hoisted_7$4 = {
1213
+ var _hoisted_1$9 = { class: "flex items-center justify-between text-[10px] font-bold text-indigo-600/90 tracking-wider uppercase" };
1214
+ var _hoisted_2$9 = { class: "flex items-center gap-1.5" };
1215
+ var _hoisted_3$9 = { class: "bg-indigo-100/60 text-indigo-700 px-1.5 py-0.5 rounded font-mono font-medium lowercase" };
1216
+ var _hoisted_4$9 = { class: "grid gap-x-4 gap-y-3 grid-cols-2" };
1217
+ var _hoisted_5$8 = { class: "text-[10px] font-semibold text-slate-400 uppercase tracking-wide" };
1218
+ var _hoisted_6$8 = ["data-testid"];
1219
+ var _hoisted_7$8 = {
340
1220
  key: 0,
341
1221
  class: "material-icons text-emerald-600 text-sm align-middle"
342
1222
  };
343
- var _hoisted_8$4 = {
1223
+ var _hoisted_8$8 = {
344
1224
  key: 1,
345
1225
  class: "text-slate-300"
346
1226
  };
347
- var _hoisted_9$4 = {
1227
+ var _hoisted_9$8 = {
348
1228
  key: 1,
349
1229
  class: "whitespace-pre-wrap font-normal text-slate-600"
350
1230
  };
351
- var _hoisted_10$4 = { key: 2 };
352
- var _hoisted_11$4 = ["data-testid"];
353
- var _hoisted_12$3 = { class: "flex items-start gap-3" };
354
- var _hoisted_13$3 = { class: "flex-1 min-w-0" };
355
- var _hoisted_14$2 = { class: "text-xs font-semibold text-red-800 uppercase tracking-wider mb-1" };
356
- var _hoisted_15$2 = ["data-testid"];
1231
+ var _hoisted_10$8 = { key: 2 };
1232
+ var _hoisted_11$8 = ["data-testid"];
1233
+ var _hoisted_12$7 = { class: "flex items-start gap-3" };
1234
+ var _hoisted_13$6 = { class: "flex-1 min-w-0" };
1235
+ var _hoisted_14$5 = { class: "text-xs font-semibold text-red-800 uppercase tracking-wider mb-1" };
1236
+ var _hoisted_15$5 = ["data-testid"];
357
1237
  //#endregion
358
1238
  //#region src/vue/components/CollectionEmbedView.vue
359
1239
  var CollectionEmbedView_default = /* @__PURE__ */ (0, vue.defineComponent)({
@@ -363,7 +1243,7 @@ var CollectionEmbedView_default = /* @__PURE__ */ (0, vue.defineComponent)({
363
1243
  fieldKey: {}
364
1244
  },
365
1245
  setup(__props) {
366
- const { t } = (0, vue_i18n.useI18n)();
1246
+ const { t } = useCollectionI18n();
367
1247
  return (_ctx, _cache) => {
368
1248
  const _component_router_link = (0, vue.resolveComponent)("router-link");
369
1249
  return __props.view.found ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
@@ -377,15 +1257,15 @@ var CollectionEmbedView_default = /* @__PURE__ */ (0, vue.defineComponent)({
377
1257
  }, {
378
1258
  default: (0, vue.withCtx)(() => [
379
1259
  _cache[1] || (_cache[1] = (0, vue.createElementVNode)("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-indigo-500 rounded-l-xl transition-all duration-300 group-hover:w-1.5 group-hover:bg-indigo-600" }, null, -1)),
380
- (0, vue.createElementVNode)("div", _hoisted_1$4, [(0, vue.createElementVNode)("div", _hoisted_2$4, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "link", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.view.targetSlug), 1)]), (0, vue.createElementVNode)("span", _hoisted_3$4, (0, vue.toDisplayString)(__props.view.recordId), 1)]),
381
- (0, vue.createElementVNode)("div", _hoisted_4$4, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.view.rows, (row) => {
1260
+ (0, vue.createElementVNode)("div", _hoisted_1$9, [(0, vue.createElementVNode)("div", _hoisted_2$9, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "link", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(__props.view.targetSlug), 1)]), (0, vue.createElementVNode)("span", _hoisted_3$9, (0, vue.toDisplayString)(__props.view.recordId), 1)]),
1261
+ (0, vue.createElementVNode)("div", _hoisted_4$9, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.view.rows, (row) => {
382
1262
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
383
1263
  key: row.key,
384
1264
  class: "space-y-0.5"
385
- }, [(0, vue.createElementVNode)("div", _hoisted_5$4, (0, vue.toDisplayString)(row.label), 1), (0, vue.createElementVNode)("div", {
1265
+ }, [(0, vue.createElementVNode)("div", _hoisted_5$8, (0, vue.toDisplayString)(row.label), 1), (0, vue.createElementVNode)("div", {
386
1266
  class: "text-xs text-slate-700 font-medium break-words",
387
1267
  "data-testid": `collections-embed-${__props.fieldKey}-${row.key}`
388
- }, [row.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [row.value === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7$4, "check_circle")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8$4, "—"))], 64)) : row.type === "markdown" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_9$4, (0, vue.toDisplayString)(row.display), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_10$4, (0, vue.toDisplayString)(row.display), 1))], 8, _hoisted_6$4)]);
1268
+ }, [row.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [row.value === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_7$8, "check_circle")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8$8, "—"))], 64)) : row.type === "markdown" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_9$8, (0, vue.toDisplayString)(row.display), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_10$8, (0, vue.toDisplayString)(row.display), 1))], 8, _hoisted_6$8)]);
389
1269
  }), 128))])
390
1270
  ]),
391
1271
  _: 1
@@ -393,15 +1273,15 @@ var CollectionEmbedView_default = /* @__PURE__ */ (0, vue.defineComponent)({
393
1273
  key: 1,
394
1274
  class: "relative rounded-xl border border-red-100 bg-red-50/30 p-4 pl-5 shadow-sm",
395
1275
  "data-testid": `collections-embed-${__props.fieldKey}`
396
- }, [_cache[4] || (_cache[4] = (0, vue.createElementVNode)("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-red-400 rounded-l-xl" }, null, -1)), (0, vue.createElementVNode)("div", _hoisted_12$3, [_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-500 text-lg mt-0.5" }, "error_outline", -1)), (0, vue.createElementVNode)("div", _hoisted_13$3, [
397
- (0, vue.createElementVNode)("p", _hoisted_14$2, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.embedMissingTitle")), 1),
1276
+ }, [_cache[4] || (_cache[4] = (0, vue.createElementVNode)("div", { class: "absolute left-0 top-0 bottom-0 w-1 bg-red-400 rounded-l-xl" }, null, -1)), (0, vue.createElementVNode)("div", _hoisted_12$7, [_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-500 text-lg mt-0.5" }, "error_outline", -1)), (0, vue.createElementVNode)("div", _hoisted_13$6, [
1277
+ (0, vue.createElementVNode)("p", _hoisted_14$5, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.embedMissingTitle")), 1),
398
1278
  (0, vue.createElementVNode)("p", {
399
1279
  class: "text-xs text-red-600",
400
1280
  "data-testid": `collections-embed-missing-${__props.fieldKey}`
401
1281
  }, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.embedMissing", {
402
1282
  collection: __props.view.targetSlug,
403
1283
  id: __props.view.recordId
404
- })), 9, _hoisted_15$2),
1284
+ })), 9, _hoisted_15$5),
405
1285
  __props.view.targetSlug ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
406
1286
  key: 0,
407
1287
  to: { path: `/collections/${__props.view.targetSlug}` },
@@ -410,40 +1290,40 @@ var CollectionEmbedView_default = /* @__PURE__ */ (0, vue.defineComponent)({
410
1290
  default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.embedCreate")), 1), _cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", { class: "material-icons text-xs" }, "arrow_forward", -1))]),
411
1291
  _: 1
412
1292
  }, 8, ["to"])) : (0, vue.createCommentVNode)("", true)
413
- ])])], 8, _hoisted_11$4));
1293
+ ])])], 8, _hoisted_11$8));
414
1294
  };
415
1295
  }
416
1296
  });
417
1297
  //#endregion
418
1298
  //#region src/vue/components/CollectionCalendarView.vue?vue&type=script&setup=true&lang.ts
419
- var _hoisted_1$3 = {
1299
+ var _hoisted_1$8 = {
420
1300
  class: "flex flex-col gap-3",
421
1301
  "data-testid": "collection-calendar"
422
1302
  };
423
- var _hoisted_2$3 = { class: "flex items-center gap-2" };
424
- var _hoisted_3$3 = ["aria-label"];
425
- var _hoisted_4$3 = ["aria-label"];
426
- var _hoisted_5$3 = {
1303
+ var _hoisted_2$8 = { class: "flex items-center gap-2" };
1304
+ var _hoisted_3$8 = ["aria-label"];
1305
+ var _hoisted_4$8 = ["aria-label"];
1306
+ var _hoisted_5$7 = {
427
1307
  class: "text-sm font-bold text-slate-800 flex-1",
428
1308
  "data-testid": "collection-calendar-month"
429
1309
  };
430
- var _hoisted_6$3 = { class: "grid grid-cols-7 gap-1 text-[10px] font-bold text-slate-400 uppercase tracking-wider select-none" };
431
- var _hoisted_7$3 = { class: "grid grid-cols-7 gap-1" };
432
- var _hoisted_8$3 = [
1310
+ var _hoisted_6$7 = { class: "grid grid-cols-7 gap-1 text-[10px] font-bold text-slate-400 uppercase tracking-wider select-none" };
1311
+ var _hoisted_7$7 = { class: "grid grid-cols-7 gap-1" };
1312
+ var _hoisted_8$7 = [
433
1313
  "aria-label",
434
1314
  "data-testid",
435
1315
  "onClick",
436
1316
  "onKeydown"
437
1317
  ];
438
- var _hoisted_9$3 = { class: "flex items-center justify-end" };
439
- var _hoisted_10$3 = ["data-testid", "onClick"];
440
- var _hoisted_11$3 = {
1318
+ var _hoisted_9$7 = { class: "flex items-center justify-end" };
1319
+ var _hoisted_10$7 = ["data-testid", "onClick"];
1320
+ var _hoisted_11$7 = {
441
1321
  key: 0,
442
1322
  class: "flex flex-wrap items-center gap-1.5 pt-1",
443
1323
  "data-testid": "collection-calendar-no-date"
444
1324
  };
445
- var _hoisted_12$2 = { class: "text-[10px] font-bold text-slate-400 uppercase tracking-wider mr-1" };
446
- var _hoisted_13$2 = ["data-testid", "onClick"];
1325
+ var _hoisted_12$6 = { class: "text-[10px] font-bold text-slate-400 uppercase tracking-wider mr-1" };
1326
+ var _hoisted_13$5 = ["data-testid", "onClick"];
447
1327
  /** Sort key for ordering a day's chips by start time: earliest first, with
448
1328
  * clock-less all-day records sinking to the bottom (matching the day view). */
449
1329
  var DAY_CHIP_DEFAULT = "bg-indigo-50 text-indigo-700 border-indigo-100 hover:bg-indigo-100";
@@ -465,33 +1345,33 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
465
1345
  setup(__props, { emit: __emit }) {
466
1346
  const props = __props;
467
1347
  const emit = __emit;
468
- const { t, locale } = (0, vue_i18n.useI18n)();
1348
+ const { t, locale } = useCollectionI18n();
469
1349
  const now = /* @__PURE__ */ new Date();
470
1350
  const viewYear = (0, vue.ref)(now.getFullYear());
471
1351
  const viewMonth = (0, vue.ref)(now.getMonth() + 1);
472
- const todayKey = require_calendarGrid.ymdKey({
1352
+ const todayKey = require_promptSafety.ymdKey({
473
1353
  year: now.getFullYear(),
474
1354
  month: now.getMonth() + 1,
475
1355
  day: now.getDate()
476
1356
  });
477
- const grid = (0, vue.computed)(() => require_calendarGrid.buildMonthGrid(viewYear.value, viewMonth.value));
478
- const bucketed = (0, vue.computed)(() => require_calendarGrid.bucketRecords(props.items, props.anchorField, props.endField, props.timeField));
479
- const labelField = (0, vue.computed)(() => require_calendarGrid.labelFieldFor(props.schema));
1357
+ const grid = (0, vue.computed)(() => require_promptSafety.buildMonthGrid(viewYear.value, viewMonth.value));
1358
+ const bucketed = (0, vue.computed)(() => require_promptSafety.bucketRecords(props.items, props.anchorField, props.endField, props.timeField));
1359
+ const labelField = (0, vue.computed)(() => require_promptSafety.labelFieldFor(props.schema));
480
1360
  function colorOf(item) {
481
- return props.colorField ? require_calendarGrid.resolveEnumColor(props.schema, props.colorField, item[props.colorField]) : null;
1361
+ return props.colorField ? require_promptSafety.resolveEnumColor(props.schema, props.colorField, item[props.colorField]) : null;
482
1362
  }
483
1363
  function sliceStartKey(slice) {
484
- return slice.kind === "allDay" ? require_calendarGrid.MINUTES_PER_DAY + 1 : slice.startMin;
1364
+ return slice.kind === "allDay" ? require_promptSafety.MINUTES_PER_DAY + 1 : slice.startMin;
485
1365
  }
486
1366
  /** Records whose span covers a given day, ordered by start time so the month
487
1367
  * grid stacks chips the same way the day (time-allocation) view does. */
488
1368
  function recordsOnDay(day) {
489
1369
  return bucketed.value.spans.map((span) => ({
490
1370
  span,
491
- slice: require_calendarGrid.daySlice(span, day)
1371
+ slice: require_promptSafety.daySlice(span, day)
492
1372
  })).filter((pair) => pair.slice !== null).sort((left, right) => sliceStartKey(left.slice) - sliceStartKey(right.slice)).map(({ span }) => ({
493
- id: require_calendarGrid.itemIdOf(span.item, props.schema),
494
- label: require_calendarGrid.itemLabelOf(span.item, props.schema, labelField.value),
1373
+ id: require_promptSafety.itemIdOf(span.item, props.schema),
1374
+ label: require_promptSafety.itemLabelOf(span.item, props.schema, labelField.value),
495
1375
  color: colorOf(span.item)
496
1376
  }));
497
1377
  }
@@ -502,8 +1382,8 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
502
1382
  entries: recordsOnDay(cell.ymd)
503
1383
  })));
504
1384
  const undatedEntries = (0, vue.computed)(() => bucketed.value.noDate.map((item) => ({
505
- id: require_calendarGrid.itemIdOf(item, props.schema),
506
- label: require_calendarGrid.itemLabelOf(item, props.schema, labelField.value),
1385
+ id: require_promptSafety.itemIdOf(item, props.schema),
1386
+ label: require_promptSafety.itemLabelOf(item, props.schema, labelField.value),
507
1387
  color: colorOf(item)
508
1388
  })));
509
1389
  function chipClass(entry, uncolored) {
@@ -557,23 +1437,23 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
557
1437
  viewMonth.value = now.getMonth() + 1;
558
1438
  }
559
1439
  return (_ctx, _cache) => {
560
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$3, [
561
- (0, vue.createElementVNode)("div", _hoisted_2$3, [
1440
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$8, [
1441
+ (0, vue.createElementVNode)("div", _hoisted_2$8, [
562
1442
  (0, vue.createElementVNode)("button", {
563
1443
  type: "button",
564
1444
  class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
565
1445
  "aria-label": (0, vue.unref)(t)("collectionsView.calendarPrevMonth"),
566
1446
  "data-testid": "collection-calendar-prev",
567
1447
  onClick: _cache[0] || (_cache[0] = ($event) => stepMonth(-1))
568
- }, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "chevron_left", -1)])], 8, _hoisted_3$3),
1448
+ }, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "chevron_left", -1)])], 8, _hoisted_3$8),
569
1449
  (0, vue.createElementVNode)("button", {
570
1450
  type: "button",
571
1451
  class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
572
1452
  "aria-label": (0, vue.unref)(t)("collectionsView.calendarNextMonth"),
573
1453
  "data-testid": "collection-calendar-next",
574
1454
  onClick: _cache[1] || (_cache[1] = ($event) => stepMonth(1))
575
- }, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "chevron_right", -1)])], 8, _hoisted_4$3),
576
- (0, vue.createElementVNode)("h3", _hoisted_5$3, (0, vue.toDisplayString)(monthLabel.value), 1),
1455
+ }, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "chevron_right", -1)])], 8, _hoisted_4$8),
1456
+ (0, vue.createElementVNode)("h3", _hoisted_5$7, (0, vue.toDisplayString)(monthLabel.value), 1),
577
1457
  (0, vue.createElementVNode)("button", {
578
1458
  type: "button",
579
1459
  class: "h-8 px-2.5 flex items-center gap-1 rounded border border-slate-200 bg-white text-slate-600 hover:bg-slate-50 text-xs font-bold transition-colors",
@@ -581,13 +1461,13 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
581
1461
  onClick: goToday
582
1462
  }, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.calendarToday")), 1)
583
1463
  ]),
584
- (0, vue.createElementVNode)("div", _hoisted_6$3, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(weekdayLabels.value, (label, idx) => {
1464
+ (0, vue.createElementVNode)("div", _hoisted_6$7, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(weekdayLabels.value, (label, idx) => {
585
1465
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
586
1466
  key: idx,
587
1467
  class: "px-1 py-1 text-center"
588
1468
  }, (0, vue.toDisplayString)(label), 1);
589
1469
  }), 128))]),
590
- (0, vue.createElementVNode)("div", _hoisted_7$3, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(cells.value, ({ cell, entries }) => {
1470
+ (0, vue.createElementVNode)("div", _hoisted_7$7, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(cells.value, ({ cell, entries }) => {
591
1471
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
592
1472
  key: cell.key,
593
1473
  class: (0, vue.normalizeClass)(["min-h-[5.5rem] rounded-lg border p-1 flex flex-col gap-1 overflow-hidden transition-colors cursor-pointer hover:border-indigo-300 focus:outline-none focus:ring-2 focus:ring-indigo-500/30", cell.inMonth ? "bg-white border-slate-200" : "bg-slate-50/50 border-slate-100"]),
@@ -597,24 +1477,24 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
597
1477
  "data-testid": `collection-calendar-day-${cell.key}`,
598
1478
  onClick: ($event) => emit("openDay", cell.ymd),
599
1479
  onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(($event) => emit("openDay", cell.ymd), ["self", "prevent"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(($event) => emit("openDay", cell.ymd), ["self", "prevent"]), ["space"])]
600
- }, [(0, vue.createElementVNode)("div", _hoisted_9$3, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["text-[11px] font-bold h-5 min-w-5 px-1 inline-flex items-center justify-center rounded-full", cell.key === (0, vue.unref)(todayKey) ? "bg-indigo-600 text-white" : cell.inMonth ? "text-slate-500" : "text-slate-300"]) }, (0, vue.toDisplayString)(cell.ymd.day), 3)]), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(entries, (entry) => {
1480
+ }, [(0, vue.createElementVNode)("div", _hoisted_9$7, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["text-[11px] font-bold h-5 min-w-5 px-1 inline-flex items-center justify-center rounded-full", cell.key === (0, vue.unref)(todayKey) ? "bg-indigo-600 text-white" : cell.inMonth ? "text-slate-500" : "text-slate-300"]) }, (0, vue.toDisplayString)(cell.ymd.day), 3)]), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(entries, (entry) => {
601
1481
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
602
1482
  key: entry.id,
603
1483
  type: "button",
604
1484
  class: (0, vue.normalizeClass)(["text-left text-[11px] leading-tight font-semibold truncate rounded px-1.5 py-0.5 border transition-colors", chipClass(entry, DAY_CHIP_DEFAULT)]),
605
1485
  "data-testid": `collection-calendar-chip-${entry.id}`,
606
1486
  onClick: (0, vue.withModifiers)(($event) => emit("select", entry.id), ["stop"])
607
- }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_10$3);
608
- }), 128))], 42, _hoisted_8$3);
1487
+ }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_10$7);
1488
+ }), 128))], 42, _hoisted_8$7);
609
1489
  }), 128))]),
610
- bucketed.value.noDate.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_11$3, [(0, vue.createElementVNode)("span", _hoisted_12$2, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.calendarNoDate")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(undatedEntries.value, (entry) => {
1490
+ bucketed.value.noDate.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_11$7, [(0, vue.createElementVNode)("span", _hoisted_12$6, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.calendarNoDate")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(undatedEntries.value, (entry) => {
611
1491
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
612
1492
  key: entry.id,
613
1493
  type: "button",
614
1494
  class: (0, vue.normalizeClass)(["text-[11px] font-semibold truncate rounded px-1.5 py-0.5 border transition-colors", chipClass(entry, UNDATED_CHIP_DEFAULT)]),
615
1495
  "data-testid": `collection-calendar-undated-${entry.id}`,
616
1496
  onClick: ($event) => emit("select", entry.id)
617
- }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_13$2);
1497
+ }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_13$5);
618
1498
  }), 128))])) : (0, vue.createCommentVNode)("", true)
619
1499
  ]);
620
1500
  };
@@ -622,40 +1502,40 @@ var CollectionCalendarView_default = /* @__PURE__ */ (0, vue.defineComponent)({
622
1502
  });
623
1503
  //#endregion
624
1504
  //#region src/vue/components/CollectionDayView.vue?vue&type=script&setup=true&lang.ts
625
- var _hoisted_1$2 = { class: "flex items-center gap-2 border-b border-slate-200 px-4 py-3" };
626
- var _hoisted_2$2 = {
1505
+ var _hoisted_1$7 = { class: "flex items-center gap-2 border-b border-slate-200 px-4 py-3" };
1506
+ var _hoisted_2$7 = {
627
1507
  class: "flex-1 text-sm font-bold text-slate-800",
628
1508
  "data-testid": "collection-day-view-title"
629
1509
  };
630
- var _hoisted_3$2 = ["aria-label"];
631
- var _hoisted_4$2 = ["aria-label"];
632
- var _hoisted_5$2 = {
1510
+ var _hoisted_3$7 = ["aria-label"];
1511
+ var _hoisted_4$7 = ["aria-label"];
1512
+ var _hoisted_5$6 = {
633
1513
  key: 0,
634
1514
  class: "px-4 py-10 text-center text-sm text-slate-400"
635
1515
  };
636
- var _hoisted_6$2 = { class: "absolute -top-2 left-0 w-10 pr-1 text-right text-[10px] tabular-nums text-slate-400" };
637
- var _hoisted_7$2 = {
1516
+ var _hoisted_6$6 = { class: "absolute -top-2 left-0 w-10 pr-1 text-right text-[10px] tabular-nums text-slate-400" };
1517
+ var _hoisted_7$6 = {
638
1518
  class: "absolute inset-y-0 right-0",
639
1519
  style: { "left": "2.75rem" }
640
1520
  };
641
- var _hoisted_8$2 = ["data-testid", "onClick"];
642
- var _hoisted_9$2 = { class: "block truncate text-[11px] font-semibold leading-tight" };
643
- var _hoisted_10$2 = {
1521
+ var _hoisted_8$6 = ["data-testid", "onClick"];
1522
+ var _hoisted_9$6 = { class: "block truncate text-[11px] font-semibold leading-tight" };
1523
+ var _hoisted_10$6 = {
644
1524
  key: 0,
645
1525
  "aria-hidden": "true"
646
1526
  };
647
- var _hoisted_11$2 = {
1527
+ var _hoisted_11$6 = {
648
1528
  key: 1,
649
1529
  "aria-hidden": "true"
650
1530
  };
651
- var _hoisted_12$1 = {
1531
+ var _hoisted_12$5 = {
652
1532
  key: 2,
653
1533
  class: "flex flex-wrap items-center gap-1.5 border-t border-slate-200 px-4 py-2",
654
1534
  "data-testid": "collection-day-view-all-day"
655
1535
  };
656
- var _hoisted_13$1 = { class: "mr-1 text-[10px] font-bold uppercase tracking-wider text-slate-400" };
657
- var _hoisted_14$1 = ["data-testid", "onClick"];
658
- var _hoisted_15$1 = {
1536
+ var _hoisted_13$4 = { class: "mr-1 text-[10px] font-bold uppercase tracking-wider text-slate-400" };
1537
+ var _hoisted_14$4 = ["data-testid", "onClick"];
1538
+ var _hoisted_15$4 = {
659
1539
  key: 0,
660
1540
  class: "min-w-0 flex-1 overflow-y-auto",
661
1541
  "data-testid": "collection-day-view-detail"
@@ -691,12 +1571,12 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
691
1571
  setup(__props, { emit: __emit }) {
692
1572
  const props = __props;
693
1573
  const emit = __emit;
694
- const { t, locale } = (0, vue_i18n.useI18n)();
1574
+ const { t, locale } = useCollectionI18n();
695
1575
  const TOTAL_HEIGHT = HOUR_PX * 24;
696
1576
  const PX_PER_MIN = HOUR_PX / 60;
697
1577
  const scrollEl = (0, vue.ref)(null);
698
1578
  const dialogEl = (0, vue.ref)(null);
699
- const dayKey = (0, vue.computed)(() => require_calendarGrid.ymdKey(props.day));
1579
+ const dayKey = (0, vue.computed)(() => require_promptSafety.ymdKey(props.day));
700
1580
  const dayLabel = (0, vue.computed)(() => {
701
1581
  try {
702
1582
  return new Intl.DateTimeFormat(locale.value, {
@@ -713,7 +1593,7 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
713
1593
  function hourLabel(hour) {
714
1594
  return `${String(hour).padStart(2, "0")}:00`;
715
1595
  }
716
- const labelField = (0, vue.computed)(() => require_calendarGrid.labelFieldFor(props.schema));
1596
+ const labelField = (0, vue.computed)(() => require_promptSafety.labelFieldFor(props.schema));
717
1597
  const CHIP_SKIP_TYPES = new Set([
718
1598
  "date",
719
1599
  "datetime",
@@ -737,17 +1617,17 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
737
1617
  return out;
738
1618
  }
739
1619
  function colorOf(item) {
740
- return props.colorField ? require_calendarGrid.resolveEnumColor(props.schema, props.colorField, item[props.colorField]) : null;
1620
+ return props.colorField ? require_promptSafety.resolveEnumColor(props.schema, props.colorField, item[props.colorField]) : null;
741
1621
  }
742
1622
  const dayEntries = (0, vue.computed)(() => {
743
- const { spans } = require_calendarGrid.bucketRecords(props.items, props.anchorField, props.endField, props.timeField);
1623
+ const { spans } = require_promptSafety.bucketRecords(props.items, props.anchorField, props.endField, props.timeField);
744
1624
  const entries = [];
745
1625
  for (const span of spans) {
746
- const slice = require_calendarGrid.daySlice(span, props.day);
1626
+ const slice = require_promptSafety.daySlice(span, props.day);
747
1627
  if (!slice) continue;
748
1628
  entries.push({
749
- id: require_calendarGrid.itemIdOf(span.item, props.schema),
750
- label: require_calendarGrid.itemLabelOf(span.item, props.schema, labelField.value),
1629
+ id: require_promptSafety.itemIdOf(span.item, props.schema),
1630
+ label: require_promptSafety.itemLabelOf(span.item, props.schema, labelField.value),
751
1631
  secondary: secondaryFieldsOf(span.item),
752
1632
  color: colorOf(span.item),
753
1633
  slice
@@ -758,7 +1638,7 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
758
1638
  const allDayEntries = (0, vue.computed)(() => dayEntries.value.filter((entry) => entry.slice.kind === "allDay"));
759
1639
  const timedEntries = (0, vue.computed)(() => {
760
1640
  const timed = dayEntries.value.filter((entry) => entry.slice.kind !== "allDay");
761
- const lanes = require_calendarGrid.assignLanes(timed.map((entry) => ({
1641
+ const lanes = require_promptSafety.assignLanes(timed.map((entry) => ({
762
1642
  startMin: entry.slice.startMin,
763
1643
  endMin: Math.max(entry.slice.endMin, entry.slice.startMin + LANE_MIN_MINUTES)
764
1644
  })));
@@ -796,7 +1676,7 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
796
1676
  (0, vue.onMounted)(async () => {
797
1677
  await (0, vue.nextTick)();
798
1678
  dialogEl.value?.focus();
799
- const earliest = timedEntries.value.reduce((min, entry) => Math.min(min, entry.slice.startMin), require_calendarGrid.MINUTES_PER_DAY);
1679
+ const earliest = timedEntries.value.reduce((min, entry) => Math.min(min, entry.slice.startMin), require_promptSafety.MINUTES_PER_DAY);
800
1680
  if (earliest >= 1440) return;
801
1681
  if (scrollEl.value) scrollEl.value.scrollTop = Math.max(0, (earliest - 60) * PX_PER_MIN);
802
1682
  });
@@ -814,8 +1694,8 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
814
1694
  role: "dialog",
815
1695
  "aria-modal": "true"
816
1696
  }, [(0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["flex min-h-0 flex-col", __props.showDetail ? "w-80 shrink-0 border-r border-slate-200" : "w-full"]) }, [
817
- (0, vue.createElementVNode)("div", _hoisted_1$2, [
818
- (0, vue.createElementVNode)("h3", _hoisted_2$2, (0, vue.toDisplayString)(dayLabel.value), 1),
1697
+ (0, vue.createElementVNode)("div", _hoisted_1$7, [
1698
+ (0, vue.createElementVNode)("h3", _hoisted_2$7, (0, vue.toDisplayString)(dayLabel.value), 1),
819
1699
  __props.canCreate ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
820
1700
  key: 0,
821
1701
  type: "button",
@@ -823,16 +1703,16 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
823
1703
  "aria-label": (0, vue.unref)(t)("collectionsView.calendarCreateOn", { date: dayKey.value }),
824
1704
  "data-testid": "collection-day-view-create",
825
1705
  onClick: onCreate
826
- }, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "add", -1)])], 8, _hoisted_3$2)) : (0, vue.createCommentVNode)("", true),
1706
+ }, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "add", -1)])], 8, _hoisted_3$7)) : (0, vue.createCommentVNode)("", true),
827
1707
  (0, vue.createElementVNode)("button", {
828
1708
  type: "button",
829
1709
  class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-100 transition-colors",
830
1710
  "aria-label": (0, vue.unref)(t)("collectionsView.dayViewClose"),
831
1711
  "data-testid": "collection-day-view-close",
832
1712
  onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
833
- }, [..._cache[4] || (_cache[4] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_4$2)
1713
+ }, [..._cache[4] || (_cache[4] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_4$7)
834
1714
  ]),
835
- timedEntries.value.length === 0 && allDayEntries.value.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$2, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dayViewEmpty")), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
1715
+ timedEntries.value.length === 0 && allDayEntries.value.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$6, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dayViewEmpty")), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
836
1716
  key: 1,
837
1717
  ref_key: "scrollEl",
838
1718
  ref: scrollEl,
@@ -846,8 +1726,8 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
846
1726
  key: hour,
847
1727
  class: "absolute left-0 right-0 border-t border-slate-100",
848
1728
  style: (0, vue.normalizeStyle)({ top: `${(hour - 1) * HOUR_PX}px` })
849
- }, [(0, vue.createElementVNode)("span", _hoisted_6$2, (0, vue.toDisplayString)(hourLabel(hour - 1)), 1)], 4);
850
- }), 64)), (0, vue.createElementVNode)("div", _hoisted_7$2, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(timedEntries.value, (entry) => {
1729
+ }, [(0, vue.createElementVNode)("span", _hoisted_6$6, (0, vue.toDisplayString)(hourLabel(hour - 1)), 1)], 4);
1730
+ }), 64)), (0, vue.createElementVNode)("div", _hoisted_7$6, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(timedEntries.value, (entry) => {
851
1731
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
852
1732
  key: entry.id,
853
1733
  type: "button",
@@ -855,56 +1735,56 @@ var CollectionDayView_default = /* @__PURE__ */ (0, vue.defineComponent)({
855
1735
  style: (0, vue.normalizeStyle)(entry.style),
856
1736
  "data-testid": `collection-day-view-chip-${entry.id}`,
857
1737
  onClick: ($event) => onSelect(entry.id)
858
- }, [(0, vue.createElementVNode)("span", _hoisted_9$2, [
859
- entry.slice.bleedsBefore ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_10$2, "▲ ")) : (0, vue.createCommentVNode)("", true),
1738
+ }, [(0, vue.createElementVNode)("span", _hoisted_9$6, [
1739
+ entry.slice.bleedsBefore ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_10$6, "▲ ")) : (0, vue.createCommentVNode)("", true),
860
1740
  (0, vue.createTextVNode)((0, vue.toDisplayString)(entry.label), 1),
861
- entry.slice.bleedsAfter ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_11$2, " ▼")) : (0, vue.createCommentVNode)("", true)
1741
+ entry.slice.bleedsAfter ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_11$6, " ▼")) : (0, vue.createCommentVNode)("", true)
862
1742
  ]), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(entry.secondary, (text, i) => {
863
1743
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
864
1744
  key: i,
865
1745
  class: "block truncate text-[10px] leading-tight opacity-70"
866
1746
  }, (0, vue.toDisplayString)(text), 1);
867
- }), 128))], 14, _hoisted_8$2);
1747
+ }), 128))], 14, _hoisted_8$6);
868
1748
  }), 128))])], 4)], 512)),
869
- allDayEntries.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_12$1, [(0, vue.createElementVNode)("span", _hoisted_13$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dayViewAllDay")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayEntries.value, (entry) => {
1749
+ allDayEntries.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_12$5, [(0, vue.createElementVNode)("span", _hoisted_13$4, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dayViewAllDay")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(allDayEntries.value, (entry) => {
870
1750
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
871
1751
  key: entry.id,
872
1752
  type: "button",
873
1753
  class: (0, vue.normalizeClass)(["truncate rounded border px-1.5 py-0.5 text-[11px] font-semibold transition-colors", allDayChipClass(entry)]),
874
1754
  "data-testid": `collection-day-view-allday-${entry.id}`,
875
1755
  onClick: ($event) => onSelect(entry.id)
876
- }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_14$1);
1756
+ }, (0, vue.toDisplayString)(entry.label), 11, _hoisted_14$4);
877
1757
  }), 128))])) : (0, vue.createCommentVNode)("", true)
878
- ], 2), __props.showDetail ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_15$1, [(0, vue.renderSlot)(_ctx.$slots, "detail")])) : (0, vue.createCommentVNode)("", true)], 2)], 32);
1758
+ ], 2), __props.showDetail ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_15$4, [(0, vue.renderSlot)(_ctx.$slots, "detail")])) : (0, vue.createCommentVNode)("", true)], 2)], 32);
879
1759
  };
880
1760
  }
881
1761
  });
882
1762
  //#endregion
883
1763
  //#region src/vue/components/CollectionKanbanView.vue?vue&type=script&setup=true&lang.ts
884
- var _hoisted_1$1 = {
1764
+ var _hoisted_1$6 = {
885
1765
  class: "h-full overflow-x-auto overflow-y-hidden",
886
1766
  "data-testid": "collection-kanban"
887
1767
  };
888
- var _hoisted_2$1 = { class: "flex gap-3 h-full p-1 min-w-max" };
889
- var _hoisted_3$1 = ["data-testid"];
890
- var _hoisted_4$1 = { class: "flex items-center justify-between px-3 py-2 border-b border-slate-200" };
891
- var _hoisted_5$1 = { class: "flex items-center gap-2 min-w-0" };
892
- var _hoisted_6$1 = ["title"];
893
- var _hoisted_7$1 = { class: "text-[11px] text-slate-400 shrink-0" };
894
- var _hoisted_8$1 = [
1768
+ var _hoisted_2$6 = { class: "flex gap-3 h-full p-1 min-w-max" };
1769
+ var _hoisted_3$6 = ["data-testid"];
1770
+ var _hoisted_4$6 = { class: "flex items-center justify-between px-3 py-2 border-b border-slate-200" };
1771
+ var _hoisted_5$5 = { class: "flex items-center gap-2 min-w-0" };
1772
+ var _hoisted_6$5 = ["title"];
1773
+ var _hoisted_7$5 = { class: "text-[11px] text-slate-400 shrink-0" };
1774
+ var _hoisted_8$5 = [
895
1775
  "data-testid",
896
1776
  "aria-label",
897
1777
  "onClick",
898
1778
  "onKeydown"
899
1779
  ];
900
- var _hoisted_9$1 = { class: "flex items-start gap-2" };
901
- var _hoisted_10$1 = [
1780
+ var _hoisted_9$5 = { class: "flex items-start gap-2" };
1781
+ var _hoisted_10$5 = [
902
1782
  "checked",
903
1783
  "aria-label",
904
1784
  "data-testid",
905
1785
  "onChange"
906
1786
  ];
907
- var _hoisted_11$1 = { class: "text-sm font-medium text-slate-800 truncate" };
1787
+ var _hoisted_11$5 = { class: "text-sm font-medium text-slate-800 truncate" };
908
1788
  var UNCATEGORIZED = "";
909
1789
  //#endregion
910
1790
  //#region src/vue/components/CollectionKanbanView.vue
@@ -921,7 +1801,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
921
1801
  setup(__props, { emit: __emit }) {
922
1802
  const props = __props;
923
1803
  const emit = __emit;
924
- const { t } = (0, vue_i18n.useI18n)();
1804
+ const { t } = useCollectionI18n();
925
1805
  /** The Uncategorized column uses the empty string as its sentinel value. */
926
1806
  const groupSpec = (0, vue.computed)(() => props.schema.fields[props.groupField]);
927
1807
  /** Declared enum values become columns in order, with a trailing
@@ -970,7 +1850,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
970
1850
  const value = String(raw);
971
1851
  return (groupSpec.value?.values ?? []).includes(value) ? value : UNCATEGORIZED;
972
1852
  }
973
- const visibleItems = (0, vue.computed)(() => groupSpec.value ? props.items.filter((item) => require_calendarGrid.fieldVisible(groupSpec.value, item)) : []);
1853
+ const visibleItems = (0, vue.computed)(() => groupSpec.value ? props.items.filter((item) => require_promptSafety.fieldVisible(groupSpec.value, item)) : []);
974
1854
  const itemsByColumnMap = (0, vue.computed)(() => {
975
1855
  const map = /* @__PURE__ */ new Map();
976
1856
  for (const column of columns.value) map.set(column.value, []);
@@ -1002,15 +1882,15 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
1002
1882
  emit("move", itemId(item), next);
1003
1883
  }
1004
1884
  return (_ctx, _cache) => {
1005
- return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, [(0, vue.createElementVNode)("div", _hoisted_2$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(columns.value, (column) => {
1885
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$6, [(0, vue.createElementVNode)("div", _hoisted_2$6, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(columns.value, (column) => {
1006
1886
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
1007
1887
  key: column.value,
1008
1888
  "data-testid": `collection-kanban-column-${column.value || "uncategorized"}`,
1009
1889
  class: "w-72 shrink-0 flex flex-col bg-slate-100 rounded-lg"
1010
- }, [(0, vue.createElementVNode)("div", _hoisted_4$1, [(0, vue.createElementVNode)("div", _hoisted_5$1, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["w-2 h-2 rounded-full shrink-0", (0, vue.unref)(require_calendarGrid.resolveEnumColor)(__props.schema, __props.groupField, column.value).dot]) }, null, 2), (0, vue.createElementVNode)("span", {
1890
+ }, [(0, vue.createElementVNode)("div", _hoisted_4$6, [(0, vue.createElementVNode)("div", _hoisted_5$5, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["w-2 h-2 rounded-full shrink-0", (0, vue.unref)(require_promptSafety.resolveEnumColor)(__props.schema, __props.groupField, column.value).dot]) }, null, 2), (0, vue.createElementVNode)("span", {
1011
1891
  class: "font-semibold text-xs text-slate-600 truncate",
1012
1892
  title: column.label
1013
- }, (0, vue.toDisplayString)(column.label), 9, _hoisted_6$1)]), (0, vue.createElementVNode)("span", _hoisted_7$1, (0, vue.toDisplayString)(itemsByColumn(column.value).length), 1)]), (0, vue.createVNode)((0, vue.unref)(vuedraggable.default), {
1893
+ }, (0, vue.toDisplayString)(column.label), 9, _hoisted_6$5)]), (0, vue.createElementVNode)("span", _hoisted_7$5, (0, vue.toDisplayString)(itemsByColumn(column.value).length), 1)]), (0, vue.createVNode)((0, vue.unref)(vuedraggable.default), {
1014
1894
  "model-value": itemsByColumn(column.value),
1015
1895
  "item-key": __props.schema.primaryKey,
1016
1896
  group: "collection-kanban-cards",
@@ -1026,7 +1906,7 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
1026
1906
  class: (0, vue.normalizeClass)(["bg-white border border-slate-200 rounded shadow-sm p-2 cursor-grab hover:shadow active:cursor-grabbing focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-400", [itemId(element) === __props.selected ? "ring-2 ring-indigo-500 border-indigo-300" : "", notifyAccentClass(element)]]),
1027
1907
  onClick: ($event) => emit("select", itemId(element)),
1028
1908
  onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)((e) => !e.repeat && emit("select", itemId(element)), ["prevent", "self"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)((e) => !e.repeat && emit("select", itemId(element)), ["prevent", "self"]), ["space"])]
1029
- }, [(0, vue.createElementVNode)("div", _hoisted_9$1, [cardToggle.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
1909
+ }, [(0, vue.createElementVNode)("div", _hoisted_9$5, [cardToggle.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
1030
1910
  key: 0,
1031
1911
  type: "checkbox",
1032
1912
  checked: cardChecked(element),
@@ -1035,124 +1915,124 @@ var CollectionKanbanView_default = /* @__PURE__ */ (0, vue.defineComponent)({
1035
1915
  "data-testid": `collection-kanban-toggle-${itemId(element)}`,
1036
1916
  onClick: _cache[0] || (_cache[0] = (0, vue.withModifiers)(() => {}, ["stop"])),
1037
1917
  onChange: ($event) => onCardToggle(element)
1038
- }, null, 40, _hoisted_10$1)) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_11$1, (0, vue.toDisplayString)(itemLabel(element)), 1)])], 42, _hoisted_8$1)]),
1918
+ }, null, 40, _hoisted_10$5)) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_11$5, (0, vue.toDisplayString)(itemLabel(element)), 1)])], 42, _hoisted_8$5)]),
1039
1919
  _: 1
1040
1920
  }, 8, [
1041
1921
  "model-value",
1042
1922
  "item-key",
1043
1923
  "onChange"
1044
- ])], 8, _hoisted_3$1);
1924
+ ])], 8, _hoisted_3$6);
1045
1925
  }), 128))])]);
1046
1926
  };
1047
1927
  }
1048
1928
  });
1049
1929
  //#endregion
1050
1930
  //#region src/vue/components/CollectionRecordPanel.vue?vue&type=script&setup=true&lang.ts
1051
- var _hoisted_1 = { class: "flex items-center gap-2 mb-4" };
1052
- var _hoisted_2 = { class: "flex-1 min-w-0" };
1053
- var _hoisted_3 = { class: "block text-[9px] font-bold text-slate-400 uppercase tracking-wider" };
1054
- var _hoisted_4 = ["data-testid"];
1055
- var _hoisted_5 = ["disabled"];
1056
- var _hoisted_6 = {
1931
+ var _hoisted_1$5 = { class: "flex items-center gap-2 mb-4" };
1932
+ var _hoisted_2$5 = { class: "flex-1 min-w-0" };
1933
+ var _hoisted_3$5 = { class: "block text-[9px] font-bold text-slate-400 uppercase tracking-wider" };
1934
+ var _hoisted_4$5 = ["data-testid"];
1935
+ var _hoisted_5$4 = ["disabled"];
1936
+ var _hoisted_6$4 = {
1057
1937
  key: 1,
1058
1938
  class: "flex items-center gap-2"
1059
1939
  };
1060
- var _hoisted_7 = [
1940
+ var _hoisted_7$4 = [
1061
1941
  "disabled",
1062
1942
  "data-testid",
1063
1943
  "onClick"
1064
1944
  ];
1065
- var _hoisted_8 = {
1945
+ var _hoisted_8$4 = {
1066
1946
  key: 0,
1067
1947
  class: "material-icons text-sm"
1068
1948
  };
1069
- var _hoisted_9 = ["aria-label"];
1070
- var _hoisted_10 = {
1949
+ var _hoisted_9$4 = ["aria-label"];
1950
+ var _hoisted_10$4 = {
1071
1951
  key: 0,
1072
1952
  class: "mb-3 text-xs font-semibold text-red-600 bg-red-50 border border-red-100 p-2.5 rounded-xl shadow-sm",
1073
1953
  "data-testid": "collections-detail-action-error"
1074
1954
  };
1075
- var _hoisted_11 = { class: "grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 bg-white rounded-2xl border border-slate-200/60 p-6 shadow-sm" };
1076
- var _hoisted_12 = ["for"];
1077
- var _hoisted_13 = {
1955
+ var _hoisted_11$4 = { class: "grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-4 bg-white rounded-2xl border border-slate-200/60 p-6 shadow-sm" };
1956
+ var _hoisted_12$4 = ["for"];
1957
+ var _hoisted_13$3 = {
1078
1958
  key: 0,
1079
1959
  class: "text-rose-500 font-bold"
1080
1960
  };
1081
- var _hoisted_14 = {
1961
+ var _hoisted_14$3 = {
1082
1962
  key: 0,
1083
1963
  class: "inline-flex items-center gap-2.5 text-sm text-slate-700 cursor-pointer select-none"
1084
1964
  };
1085
- var _hoisted_15 = [
1965
+ var _hoisted_15$3 = [
1086
1966
  "id",
1087
1967
  "onUpdate:modelValue",
1088
1968
  "data-testid",
1089
1969
  "onChange"
1090
1970
  ];
1091
- var _hoisted_16 = [
1971
+ var _hoisted_16$2 = [
1092
1972
  "id",
1093
1973
  "onUpdate:modelValue",
1094
1974
  "required",
1095
1975
  "data-testid"
1096
1976
  ];
1097
- var _hoisted_17 = { value: "" };
1098
- var _hoisted_18 = ["value"];
1099
- var _hoisted_19 = [
1977
+ var _hoisted_17$2 = { value: "" };
1978
+ var _hoisted_18$2 = ["value"];
1979
+ var _hoisted_19$2 = [
1100
1980
  "id",
1101
1981
  "onUpdate:modelValue",
1102
1982
  "required",
1103
1983
  "data-testid"
1104
1984
  ];
1105
- var _hoisted_20 = { value: "" };
1106
- var _hoisted_21 = ["value"];
1107
- var _hoisted_22 = ["data-testid"];
1108
- var _hoisted_23 = {
1985
+ var _hoisted_20$2 = { value: "" };
1986
+ var _hoisted_21$2 = ["value"];
1987
+ var _hoisted_22$2 = ["data-testid"];
1988
+ var _hoisted_23$2 = {
1109
1989
  key: 0,
1110
1990
  class: "overflow-hidden border border-slate-200 rounded-lg shadow-sm"
1111
1991
  };
1112
- var _hoisted_24 = { class: "w-full text-xs text-slate-600 bg-white" };
1113
- var _hoisted_25 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
1114
- var _hoisted_26 = { class: "divide-y divide-slate-100" };
1115
- var _hoisted_27 = ["onUpdate:modelValue", "onChange"];
1116
- var _hoisted_28 = ["onUpdate:modelValue", "required"];
1117
- var _hoisted_29 = { value: "" };
1118
- var _hoisted_30 = ["value"];
1119
- var _hoisted_31 = ["onUpdate:modelValue", "required"];
1120
- var _hoisted_32 = { value: "" };
1121
- var _hoisted_33 = ["value"];
1122
- var _hoisted_34 = {
1992
+ var _hoisted_24$1 = { class: "w-full text-xs text-slate-600 bg-white" };
1993
+ var _hoisted_25$1 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
1994
+ var _hoisted_26$1 = { class: "divide-y divide-slate-100" };
1995
+ var _hoisted_27$1 = ["onUpdate:modelValue", "onChange"];
1996
+ var _hoisted_28$1 = ["onUpdate:modelValue", "required"];
1997
+ var _hoisted_29$1 = { value: "" };
1998
+ var _hoisted_30$1 = ["value"];
1999
+ var _hoisted_31$1 = ["onUpdate:modelValue", "required"];
2000
+ var _hoisted_32$1 = { value: "" };
2001
+ var _hoisted_33$1 = ["value"];
2002
+ var _hoisted_34$1 = {
1123
2003
  key: 3,
1124
2004
  class: "relative flex items-center"
1125
2005
  };
1126
- var _hoisted_35 = { class: "absolute left-1.5 text-[10px] text-slate-400 font-bold pr-1 border-r border-slate-200" };
1127
- var _hoisted_36 = ["onUpdate:modelValue", "required"];
1128
- var _hoisted_37 = [
2006
+ var _hoisted_35$1 = { class: "absolute left-1.5 text-[10px] text-slate-400 font-bold pr-1 border-r border-slate-200" };
2007
+ var _hoisted_36$1 = ["onUpdate:modelValue", "required"];
2008
+ var _hoisted_37$1 = [
1129
2009
  "onUpdate:modelValue",
1130
2010
  "type",
1131
2011
  "required"
1132
2012
  ];
1133
- var _hoisted_38 = { class: "text-center px-1" };
1134
- var _hoisted_39 = [
2013
+ var _hoisted_38$1 = { class: "text-center px-1" };
2014
+ var _hoisted_39$1 = [
1135
2015
  "aria-label",
1136
2016
  "data-testid",
1137
2017
  "onClick"
1138
2018
  ];
1139
- var _hoisted_40 = {
2019
+ var _hoisted_40$1 = {
1140
2020
  key: 1,
1141
2021
  class: "text-xs text-slate-400 italic"
1142
2022
  };
1143
- var _hoisted_41 = ["data-testid", "onClick"];
1144
- var _hoisted_42 = {
2023
+ var _hoisted_41$1 = ["data-testid", "onClick"];
2024
+ var _hoisted_42$1 = {
1145
2025
  key: 4,
1146
2026
  class: "relative flex items-center"
1147
2027
  };
1148
- var _hoisted_43 = { class: "absolute left-3 text-slate-400 font-bold text-xs select-none pr-1.5 border-r border-slate-200" };
1149
- var _hoisted_44 = [
2028
+ var _hoisted_43$1 = { class: "absolute left-3 text-slate-400 font-bold text-xs select-none pr-1.5 border-r border-slate-200" };
2029
+ var _hoisted_44$1 = [
1150
2030
  "id",
1151
2031
  "onUpdate:modelValue",
1152
2032
  "required",
1153
2033
  "data-testid"
1154
2034
  ];
1155
- var _hoisted_45 = [
2035
+ var _hoisted_45$1 = [
1156
2036
  "id",
1157
2037
  "onUpdate:modelValue",
1158
2038
  "type",
@@ -1160,77 +2040,77 @@ var _hoisted_45 = [
1160
2040
  "disabled",
1161
2041
  "data-testid"
1162
2042
  ];
1163
- var _hoisted_46 = [
2043
+ var _hoisted_46$1 = [
1164
2044
  "id",
1165
2045
  "onUpdate:modelValue",
1166
2046
  "rows",
1167
2047
  "required",
1168
2048
  "data-testid"
1169
2049
  ];
1170
- var _hoisted_47 = ["data-testid"];
1171
- var _hoisted_48 = {
2050
+ var _hoisted_47$1 = ["data-testid"];
2051
+ var _hoisted_48$1 = {
1172
2052
  key: 0,
1173
2053
  class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/40"
1174
2054
  };
1175
- var _hoisted_49 = {
2055
+ var _hoisted_49$1 = {
1176
2056
  key: 1,
1177
2057
  class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-50 text-slate-400 border border-slate-200/20"
1178
2058
  };
1179
- var _hoisted_50 = {
2059
+ var _hoisted_50$1 = {
1180
2060
  key: 0,
1181
2061
  class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/40"
1182
2062
  };
1183
- var _hoisted_51 = {
2063
+ var _hoisted_51$1 = {
1184
2064
  key: 1,
1185
2065
  class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-slate-50 text-slate-400 border border-slate-200/20"
1186
2066
  };
1187
- var _hoisted_52 = {
2067
+ var _hoisted_52$1 = {
1188
2068
  key: 2,
1189
2069
  class: "text-slate-300"
1190
2070
  };
1191
- var _hoisted_53 = {
2071
+ var _hoisted_53$1 = {
1192
2072
  key: 3,
1193
2073
  class: "font-semibold text-slate-900 tabular-nums text-sm"
1194
2074
  };
1195
- var _hoisted_54 = {
2075
+ var _hoisted_54$1 = {
1196
2076
  key: 4,
1197
2077
  class: "inline-block truncate tabular-nums font-bold text-indigo-900 bg-indigo-50/50 px-2 py-0.5 rounded border border-indigo-100/50"
1198
2078
  };
1199
- var _hoisted_55 = {
2079
+ var _hoisted_55$1 = {
1200
2080
  key: 5,
1201
2081
  class: "border border-slate-200/80 rounded-xl overflow-hidden shadow-sm mt-1"
1202
2082
  };
1203
- var _hoisted_56 = { class: "w-full text-[11px] text-slate-600 bg-white" };
1204
- var _hoisted_57 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
1205
- var _hoisted_58 = { class: "divide-y divide-slate-100" };
1206
- var _hoisted_59 = {
2083
+ var _hoisted_56$1 = { class: "w-full text-[11px] text-slate-600 bg-white" };
2084
+ var _hoisted_57$1 = { class: "bg-slate-50 border-b border-slate-200 text-slate-500 font-bold uppercase tracking-wider" };
2085
+ var _hoisted_58$1 = { class: "divide-y divide-slate-100" };
2086
+ var _hoisted_59$1 = {
1207
2087
  key: 0,
1208
2088
  class: "material-icons text-emerald-600 text-base"
1209
2089
  };
1210
- var _hoisted_60 = {
2090
+ var _hoisted_60$1 = {
1211
2091
  key: 1,
1212
2092
  class: "text-slate-300"
1213
2093
  };
1214
- var _hoisted_61 = {
2094
+ var _hoisted_61$1 = {
1215
2095
  key: 6,
1216
2096
  class: "text-slate-400 italic"
1217
2097
  };
1218
- var _hoisted_62 = {
2098
+ var _hoisted_62$1 = {
1219
2099
  key: 7,
1220
2100
  class: "bg-slate-50 rounded-xl p-4 border border-slate-200/60 text-slate-600 text-xs whitespace-pre-wrap leading-relaxed max-h-[30vh] overflow-y-auto"
1221
2101
  };
1222
- var _hoisted_63 = [
2102
+ var _hoisted_63$1 = [
1223
2103
  "src",
1224
2104
  "alt",
1225
2105
  "data-testid"
1226
2106
  ];
1227
- var _hoisted_64 = ["href", "data-testid"];
1228
- var _hoisted_65 = ["href", "data-testid"];
1229
- var _hoisted_66 = {
2107
+ var _hoisted_64$1 = ["href", "data-testid"];
2108
+ var _hoisted_65$1 = ["href", "data-testid"];
2109
+ var _hoisted_66$1 = {
1230
2110
  key: 13,
1231
2111
  class: "text-slate-800 font-semibold"
1232
2112
  };
1233
- var _hoisted_67 = {
2113
+ var _hoisted_67$1 = {
1234
2114
  key: 0,
1235
2115
  class: "col-span-full text-xs font-semibold text-red-600 bg-red-50 border border-red-100 p-2.5 rounded-xl"
1236
2116
  };
@@ -1269,7 +2149,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1269
2149
  const props = __props;
1270
2150
  const editing = (0, vue.useModel)(__props, "editing");
1271
2151
  const emit = __emit;
1272
- const { t } = (0, vue_i18n.useI18n)();
2152
+ const { t } = useCollectionI18n();
1273
2153
  const embedViews = (0, vue.computed)(() => props.render.embedViews.value);
1274
2154
  /** The record the read-only displays render from: the live draft while
1275
2155
  * editing (so non-editable cells like derived/embed preview the in-flight
@@ -1310,7 +2190,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1310
2190
  * creating. */
1311
2191
  function cellVisible(field) {
1312
2192
  if (field.primary && editing.value?.mode !== "create") return false;
1313
- return require_calendarGrid.fieldVisible(field, detailRecord.value);
2193
+ return require_promptSafety.fieldVisible(field, detailRecord.value);
1314
2194
  }
1315
2195
  /** Mirror of the create-mode primary-key carve-out: drop the HTML5
1316
2196
  * `required` flag on the primary field while creating so the browser
@@ -1324,7 +2204,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1324
2204
  * value's colour (palette, or notification red/amber/grey when the field is
1325
2205
  * the schema's notifyWhen target). */
1326
2206
  function enumControlClass(fieldKey, value) {
1327
- const cls = require_calendarGrid.resolveEnumColor(props.collection.schema, fieldKey, value);
2207
+ const cls = require_promptSafety.resolveEnumColor(props.collection.schema, fieldKey, value);
1328
2208
  return `${cls.badge} ${cls.border}`;
1329
2209
  }
1330
2210
  function markBoolTouched(key) {
@@ -1336,7 +2216,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1336
2216
  function addTableRow(key, subFields) {
1337
2217
  if (!editing.value) return;
1338
2218
  const rows = editing.value.table[key] ?? [];
1339
- rows.push(require_calendarGrid.emptyRow(subFields));
2219
+ rows.push(require_promptSafety.emptyRow(subFields));
1340
2220
  editing.value.table[key] = rows;
1341
2221
  }
1342
2222
  function removeTableRow(key, index) {
@@ -1352,10 +2232,10 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1352
2232
  onSubmit: _cache[4] || (_cache[4] = (0, vue.withModifiers)(($event) => emit("submit"), ["prevent"]))
1353
2233
  }, {
1354
2234
  default: (0, vue.withCtx)(() => [
1355
- (0, vue.createElementVNode)("div", _hoisted_1, [(0, vue.createElementVNode)("div", _hoisted_2, [(0, vue.createElementVNode)("span", _hoisted_3, (0, vue.toDisplayString)(__props.collection.title), 1), (0, vue.createElementVNode)("h2", {
2235
+ (0, vue.createElementVNode)("div", _hoisted_1$5, [(0, vue.createElementVNode)("div", _hoisted_2$5, [(0, vue.createElementVNode)("span", _hoisted_3$5, (0, vue.toDisplayString)(__props.collection.title), 1), (0, vue.createElementVNode)("h2", {
1356
2236
  class: "text-base font-bold text-slate-800 truncate",
1357
2237
  "data-testid": editing.value ? "collections-edit-title" : "collections-detail-title"
1358
- }, (0, vue.toDisplayString)(headerTitle.value), 9, _hoisted_4)]), editing.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("button", {
2238
+ }, (0, vue.toDisplayString)(headerTitle.value), 9, _hoisted_4$5)]), editing.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createElementVNode)("button", {
1359
2239
  type: "button",
1360
2240
  class: "h-8 px-2.5 rounded text-xs font-bold text-slate-500 hover:bg-slate-200/50 transition-colors",
1361
2241
  "data-testid": "collections-editor-cancel",
@@ -1365,7 +2245,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1365
2245
  class: "h-8 px-2.5 rounded bg-indigo-600 text-white font-bold text-xs hover:bg-indigo-700 disabled:opacity-50 transition-all shadow-sm shadow-indigo-600/10",
1366
2246
  disabled: __props.saving,
1367
2247
  "data-testid": "collections-editor-save"
1368
- }, (0, vue.toDisplayString)(__props.saving ? (0, vue.unref)(t)("common.saving") : (0, vue.unref)(t)("common.save")), 9, _hoisted_5)], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [
2248
+ }, (0, vue.toDisplayString)(__props.saving ? (0, vue.unref)(t)("common.saving") : (0, vue.unref)(t)("common.save")), 9, _hoisted_5$4)], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$4, [
1369
2249
  ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.visibleActions, (action) => {
1370
2250
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
1371
2251
  key: action.id,
@@ -1374,7 +2254,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1374
2254
  disabled: __props.actionPending,
1375
2255
  "data-testid": `collections-detail-action-${action.id}`,
1376
2256
  onClick: ($event) => emit("runAction", action)
1377
- }, [action.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8, (0, vue.toDisplayString)(action.icon), 1)) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(action.label), 1)], 8, _hoisted_7);
2257
+ }, [action.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8$4, (0, vue.toDisplayString)(action.icon), 1)) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(action.label), 1)], 8, _hoisted_7$4);
1378
2258
  }), 128)),
1379
2259
  (0, vue.createElementVNode)("button", {
1380
2260
  type: "button",
@@ -1394,57 +2274,57 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1394
2274
  "aria-label": (0, vue.unref)(t)("common.close"),
1395
2275
  "data-testid": "collections-detail-close",
1396
2276
  onClick: _cache[3] || (_cache[3] = ($event) => emit("close"))
1397
- }, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_9)
2277
+ }, [..._cache[7] || (_cache[7] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_9$4)
1398
2278
  ]))]),
1399
- !editing.value && __props.actionError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_10, (0, vue.toDisplayString)(__props.actionError), 1)) : (0, vue.createCommentVNode)("", true),
1400
- (0, vue.createElementVNode)("div", _hoisted_11, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.collection.schema.fields, (field, key) => {
2279
+ !editing.value && __props.actionError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_10$4, (0, vue.toDisplayString)(__props.actionError), 1)) : (0, vue.createCommentVNode)("", true),
2280
+ (0, vue.createElementVNode)("div", _hoisted_11$4, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.collection.schema.fields, (field, key) => {
1401
2281
  return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key }, [cellVisible(field) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
1402
2282
  key: 0,
1403
2283
  class: (0, vue.normalizeClass)(["flex flex-col gap-1.5", colSpanClass(field)])
1404
2284
  }, [(0, vue.createElementVNode)("label", {
1405
2285
  class: "text-[10px] font-bold text-slate-400 uppercase tracking-wider flex items-center gap-1",
1406
2286
  for: `collections-field-${key}`
1407
- }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(field.label) + " ", 1), editing.value && field.required ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_13, "*")) : (0, vue.createCommentVNode)("", true)], 8, _hoisted_12), editing.value && isEditableType(field.type) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", _hoisted_14, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
2287
+ }, [(0, vue.createTextVNode)((0, vue.toDisplayString)(field.label) + " ", 1), editing.value && field.required ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_13$3, "*")) : (0, vue.createCommentVNode)("", true)], 8, _hoisted_12$4), editing.value && isEditableType(field.type) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("label", _hoisted_14$3, [(0, vue.withDirectives)((0, vue.createElementVNode)("input", {
1408
2288
  id: `collections-field-${key}`,
1409
2289
  "onUpdate:modelValue": ($event) => editing.value.bool[key] = $event,
1410
2290
  type: "checkbox",
1411
2291
  class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer",
1412
2292
  "data-testid": `collections-input-${key}`,
1413
2293
  onChange: ($event) => markBoolTouched(String(key))
1414
- }, null, 40, _hoisted_15), [[vue.vModelCheckbox, editing.value.bool[key]]]), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["text-xs font-semibold", editing.value.bool[key] ? "text-indigo-600" : "text-slate-500"]) }, (0, vue.toDisplayString)(editing.value.bool[key] ? (0, vue.unref)(t)("common.yes") : (0, vue.unref)(t)("common.no")), 3)])) : field.type === "ref" && field.to && __props.render.refOptions(field.to).length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
2294
+ }, null, 40, _hoisted_15$3), [[vue.vModelCheckbox, editing.value.bool[key]]]), (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["text-xs font-semibold", editing.value.bool[key] ? "text-indigo-600" : "text-slate-500"]) }, (0, vue.toDisplayString)(editing.value.bool[key] ? (0, vue.unref)(t)("common.yes") : (0, vue.unref)(t)("common.no")), 3)])) : field.type === "ref" && field.to && __props.render.refOptions(field.to).length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
1415
2295
  key: 1,
1416
2296
  id: `collections-field-${key}`,
1417
2297
  "onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
1418
2298
  required: isFieldRequiredInUi(field),
1419
2299
  class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs bg-slate-50 hover:bg-slate-50/50 focus:bg-white focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none transition-all cursor-pointer font-medium text-slate-700",
1420
2300
  "data-testid": `collections-input-${key}`
1421
- }, [(0, vue.createElementVNode)("option", _hoisted_17, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.refOptions(field.to), (opt) => {
2301
+ }, [(0, vue.createElementVNode)("option", _hoisted_17$2, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.refOptions(field.to), (opt) => {
1422
2302
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
1423
2303
  key: opt.slug,
1424
2304
  value: opt.slug
1425
- }, (0, vue.toDisplayString)(opt.display), 9, _hoisted_18);
1426
- }), 128))], 8, _hoisted_16)), [[vue.vModelSelect, editing.value.text[key]]]) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
2305
+ }, (0, vue.toDisplayString)(opt.display), 9, _hoisted_18$2);
2306
+ }), 128))], 8, _hoisted_16$2)), [[vue.vModelSelect, editing.value.text[key]]]) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
1427
2307
  key: 2,
1428
2308
  id: `collections-field-${key}`,
1429
2309
  "onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
1430
2310
  required: isFieldRequiredInUi(field),
1431
2311
  class: (0, vue.normalizeClass)(["w-full rounded-xl border px-3 py-2 text-xs focus:bg-white focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none transition-all cursor-pointer font-medium", enumControlClass(String(key), editing.value.text[key])]),
1432
2312
  "data-testid": `collections-input-${key}`
1433
- }, [(0, vue.createElementVNode)("option", _hoisted_20, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.values, (value) => {
2313
+ }, [(0, vue.createElementVNode)("option", _hoisted_20$2, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.values, (value) => {
1434
2314
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
1435
2315
  key: value,
1436
2316
  value
1437
- }, (0, vue.toDisplayString)(value), 9, _hoisted_21);
1438
- }), 128))], 10, _hoisted_19)), [[vue.vModelSelect, editing.value.text[key]]]) : field.type === "table" && field.of ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
2317
+ }, (0, vue.toDisplayString)(value), 9, _hoisted_21$2);
2318
+ }), 128))], 10, _hoisted_19$2)), [[vue.vModelSelect, editing.value.text[key]]]) : field.type === "table" && field.of ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
1439
2319
  key: 3,
1440
2320
  class: "border border-slate-200 bg-slate-50/30 rounded-xl p-4 space-y-3",
1441
2321
  "data-testid": `collections-table-${key}`
1442
- }, [editing.value.table[key] && editing.value.table[key].length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_23, [(0, vue.createElementVNode)("table", _hoisted_24, [(0, vue.createElementVNode)("thead", _hoisted_25, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.of, (subField, subKey) => {
2322
+ }, [editing.value.table[key] && editing.value.table[key].length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_23$2, [(0, vue.createElementVNode)("table", _hoisted_24$1, [(0, vue.createElementVNode)("thead", _hoisted_25$1, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.of, (subField, subKey) => {
1443
2323
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
1444
2324
  key: subKey,
1445
2325
  class: "text-left px-3 py-2 font-bold"
1446
2326
  }, (0, vue.toDisplayString)(subField.label), 1);
1447
- }), 128)), _cache[8] || (_cache[8] = (0, vue.createElementVNode)("th", { class: "w-9" }, null, -1))])]), (0, vue.createElementVNode)("tbody", _hoisted_26, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(editing.value.table[key], (row, rowIdx) => {
2327
+ }), 128)), _cache[8] || (_cache[8] = (0, vue.createElementVNode)("th", { class: "w-9" }, null, -1))])]), (0, vue.createElementVNode)("tbody", _hoisted_26$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(editing.value.table[key], (row, rowIdx) => {
1448
2328
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
1449
2329
  key: rowIdx,
1450
2330
  class: "hover:bg-slate-50/50"
@@ -1458,52 +2338,52 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1458
2338
  type: "checkbox",
1459
2339
  class: "h-4 w-4 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer",
1460
2340
  onChange: ($event) => markRowBoolTouched(row, String(subKey))
1461
- }, null, 40, _hoisted_27)), [[vue.vModelCheckbox, row.bool[subKey]]]) : subField.type === "enum" && Array.isArray(subField.values) && subField.values.length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
2341
+ }, null, 40, _hoisted_27$1)), [[vue.vModelCheckbox, row.bool[subKey]]]) : subField.type === "enum" && Array.isArray(subField.values) && subField.values.length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
1462
2342
  key: 1,
1463
2343
  "onUpdate:modelValue": ($event) => row.text[subKey] = $event,
1464
2344
  required: subField.required,
1465
2345
  class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none cursor-pointer bg-slate-50 font-medium"
1466
- }, [(0, vue.createElementVNode)("option", _hoisted_29, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(subField.values, (value) => {
2346
+ }, [(0, vue.createElementVNode)("option", _hoisted_29$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(subField.values, (value) => {
1467
2347
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
1468
2348
  key: value,
1469
2349
  value
1470
- }, (0, vue.toDisplayString)(value), 9, _hoisted_30);
1471
- }), 128))], 8, _hoisted_28)), [[vue.vModelSelect, row.text[subKey]]]) : subField.type === "ref" && subField.to && __props.render.refOptions(subField.to).length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
2350
+ }, (0, vue.toDisplayString)(value), 9, _hoisted_30$1);
2351
+ }), 128))], 8, _hoisted_28$1)), [[vue.vModelSelect, row.text[subKey]]]) : subField.type === "ref" && subField.to && __props.render.refOptions(subField.to).length > 0 ? (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
1472
2352
  key: 2,
1473
2353
  "onUpdate:modelValue": ($event) => row.text[subKey] = $event,
1474
2354
  required: subField.required,
1475
2355
  class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none cursor-pointer bg-slate-50 font-medium"
1476
- }, [(0, vue.createElementVNode)("option", _hoisted_32, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.refOptions(subField.to), (opt) => {
2356
+ }, [(0, vue.createElementVNode)("option", _hoisted_32$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.refOptions(subField.to), (opt) => {
1477
2357
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
1478
2358
  key: opt.slug,
1479
2359
  value: opt.slug
1480
- }, (0, vue.toDisplayString)(opt.display), 9, _hoisted_33);
1481
- }), 128))], 8, _hoisted_31)), [[vue.vModelSelect, row.text[subKey]]]) : subField.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_34, [(0, vue.createElementVNode)("span", _hoisted_35, (0, vue.toDisplayString)(__props.render.currencySymbol(__props.render.resolveCurrency(subField, __props.liveRecord))), 1), (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
2360
+ }, (0, vue.toDisplayString)(opt.display), 9, _hoisted_33$1);
2361
+ }), 128))], 8, _hoisted_31$1)), [[vue.vModelSelect, row.text[subKey]]]) : subField.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_34$1, [(0, vue.createElementVNode)("span", _hoisted_35$1, (0, vue.toDisplayString)(__props.render.currencySymbol(__props.render.resolveCurrency(subField, __props.liveRecord))), 1), (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
1482
2362
  "onUpdate:modelValue": ($event) => row.text[subKey] = $event,
1483
2363
  type: "number",
1484
2364
  step: "0.01",
1485
2365
  required: subField.required,
1486
2366
  class: "w-full rounded-lg border border-slate-200 pl-6 pr-1.5 py-1 text-xs focus:border-indigo-500 focus:outline-none font-semibold text-slate-800"
1487
- }, null, 8, _hoisted_36), [[vue.vModelText, row.text[subKey]]])])) : (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
2367
+ }, null, 8, _hoisted_36$1), [[vue.vModelText, row.text[subKey]]])])) : (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
1488
2368
  key: 4,
1489
2369
  "onUpdate:modelValue": ($event) => row.text[subKey] = $event,
1490
2370
  type: __props.render.inputTypeFor(subField.type),
1491
2371
  required: subField.required,
1492
2372
  class: "w-full rounded-lg border border-slate-200 px-2 py-1 text-xs focus:border-indigo-500 focus:outline-none font-medium text-slate-700"
1493
- }, null, 8, _hoisted_37)), [[vue.vModelDynamic, row.text[subKey]]])]);
1494
- }), 128)), (0, vue.createElementVNode)("td", _hoisted_38, [(0, vue.createElementVNode)("button", {
2373
+ }, null, 8, _hoisted_37$1)), [[vue.vModelDynamic, row.text[subKey]]])]);
2374
+ }), 128)), (0, vue.createElementVNode)("td", _hoisted_38$1, [(0, vue.createElementVNode)("button", {
1495
2375
  type: "button",
1496
2376
  class: "h-7 w-7 flex items-center justify-center rounded-lg text-slate-400 hover:text-rose-600 hover:bg-rose-50 transition-colors",
1497
2377
  "aria-label": (0, vue.unref)(t)("collectionsView.removeRow"),
1498
2378
  "data-testid": `collections-table-${key}-remove-${rowIdx}`,
1499
2379
  onClick: ($event) => removeTableRow(String(key), rowIdx)
1500
- }, [..._cache[9] || (_cache[9] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_39)])]);
1501
- }), 128))])])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_40, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noRows")), 1)), (0, vue.createElementVNode)("button", {
2380
+ }, [..._cache[9] || (_cache[9] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_39$1)])]);
2381
+ }), 128))])])])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_40$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noRows")), 1)), (0, vue.createElementVNode)("button", {
1502
2382
  type: "button",
1503
2383
  class: "inline-flex items-center gap-1 text-xs text-indigo-600 hover:text-indigo-800 font-bold hover:underline",
1504
2384
  "data-testid": `collections-table-${key}-add`,
1505
2385
  onClick: ($event) => addTableRow(String(key), field.of)
1506
- }, [_cache[10] || (_cache[10] = (0, vue.createElementVNode)("span", { class: "material-icons text-xs" }, "add", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.addRow")), 1)], 8, _hoisted_41)], 8, _hoisted_22)) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_42, [(0, vue.createElementVNode)("div", _hoisted_43, (0, vue.toDisplayString)(__props.render.currencySymbol(__props.render.resolveCurrency(field, __props.liveRecord))), 1), (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
2386
+ }, [_cache[10] || (_cache[10] = (0, vue.createElementVNode)("span", { class: "material-icons text-xs" }, "add", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.addRow")), 1)], 8, _hoisted_41$1)], 8, _hoisted_22$2)) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_42$1, [(0, vue.createElementVNode)("div", _hoisted_43$1, (0, vue.toDisplayString)(__props.render.currencySymbol(__props.render.resolveCurrency(field, __props.liveRecord))), 1), (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
1507
2387
  id: `collections-field-${key}`,
1508
2388
  "onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
1509
2389
  type: "number",
@@ -1511,7 +2391,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1511
2391
  required: isFieldRequiredInUi(field),
1512
2392
  class: "w-full rounded-xl border border-slate-200 pl-11 pr-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none font-semibold text-slate-800 transition-all",
1513
2393
  "data-testid": `collections-input-${key}`
1514
- }, null, 8, _hoisted_44), [[vue.vModelText, editing.value.text[key]]])])) : [
2394
+ }, null, 8, _hoisted_44$1), [[vue.vModelText, editing.value.text[key]]])])) : [
1515
2395
  "string",
1516
2396
  "email",
1517
2397
  "number",
@@ -1529,7 +2409,7 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1529
2409
  disabled: field.primary === true && (editing.value.mode === "edit" || __props.isSingleton),
1530
2410
  class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none disabled:bg-slate-100 disabled:text-slate-400 font-medium text-slate-700 transition-all",
1531
2411
  "data-testid": `collections-input-${key}`
1532
- }, null, 8, _hoisted_45)), [[vue.vModelDynamic, editing.value.text[key]]]) : (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("textarea", {
2412
+ }, null, 8, _hoisted_45$1)), [[vue.vModelDynamic, editing.value.text[key]]]) : (0, vue.withDirectives)(((0, vue.openBlock)(), (0, vue.createElementBlock)("textarea", {
1533
2413
  key: 6,
1534
2414
  id: `collections-field-${key}`,
1535
2415
  "onUpdate:modelValue": ($event) => editing.value.text[key] = $event,
@@ -1537,11 +2417,11 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1537
2417
  required: isFieldRequiredInUi(field),
1538
2418
  class: "w-full rounded-xl border border-slate-200 px-3 py-2 text-xs focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none font-medium text-slate-700 transition-all",
1539
2419
  "data-testid": `collections-input-${key}`
1540
- }, null, 8, _hoisted_46)), [[vue.vModelText, editing.value.text[key]]])], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
2420
+ }, null, 8, _hoisted_46$1)), [[vue.vModelText, editing.value.text[key]]])], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
1541
2421
  key: 1,
1542
2422
  class: "text-xs font-medium text-slate-700 break-words",
1543
2423
  "data-testid": `collections-detail-value-${key}`
1544
- }, [field.type === "toggle" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.field !== void 0 && String(detailRecord.value[field.field] ?? "") === field.onValue ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_48, [_cache[11] || (_cache[11] = (0, vue.createElementVNode)("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("common.yes")), 1)])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_49, (0, vue.toDisplayString)((0, vue.unref)(t)("common.no")), 1))], 64)) : field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [detailRecord.value[key] === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_50, [_cache[12] || (_cache[12] = (0, vue.createElementVNode)("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("common.yes")), 1)])) : detailRecord.value[key] === false ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_51, (0, vue.toDisplayString)((0, vue.unref)(t)("common.no")), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_52, "—"))], 64)) : field.type === "ref" && field.to && typeof detailRecord.value[key] === "string" && detailRecord.value[key] ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
2424
+ }, [field.type === "toggle" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.field !== void 0 && String(detailRecord.value[field.field] ?? "") === field.onValue ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_48$1, [_cache[11] || (_cache[11] = (0, vue.createElementVNode)("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("common.yes")), 1)])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_49$1, (0, vue.toDisplayString)((0, vue.unref)(t)("common.no")), 1))], 64)) : field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [detailRecord.value[key] === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_50$1, [_cache[12] || (_cache[12] = (0, vue.createElementVNode)("span", { class: "h-1.5 w-1.5 rounded-full bg-emerald-500" }, null, -1)), (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)("common.yes")), 1)])) : detailRecord.value[key] === false ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_51$1, (0, vue.toDisplayString)((0, vue.unref)(t)("common.no")), 1)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_52$1, "—"))], 64)) : field.type === "ref" && field.to && typeof detailRecord.value[key] === "string" && detailRecord.value[key] ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
1545
2425
  key: 2,
1546
2426
  to: {
1547
2427
  path: `/collections/${field.to}`,
@@ -1552,12 +2432,12 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1552
2432
  }, {
1553
2433
  default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(__props.render.refDisplay(field.to, String(detailRecord.value[key]))), 1)]),
1554
2434
  _: 2
1555
- }, 1032, ["to", "data-testid"])) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_53, (0, vue.toDisplayString)(__props.render.formatMoney(detailRecord.value[key], __props.render.resolveCurrency(field, detailRecord.value), __props.locale)), 1)) : field.type === "derived" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_54, (0, vue.toDisplayString)(__props.render.derivedDisplay(field, __props.render.evaluateDerivedAgainstItem(field, String(key), detailRecord.value), detailRecord.value)), 1)) : field.type === "table" && field.of && __props.render.hasTableRows(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_55, [(0, vue.createElementVNode)("table", _hoisted_56, [(0, vue.createElementVNode)("thead", _hoisted_57, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.of, (subField, subKey) => {
2435
+ }, 1032, ["to", "data-testid"])) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_53$1, (0, vue.toDisplayString)(__props.render.formatMoney(detailRecord.value[key], __props.render.resolveCurrency(field, detailRecord.value), __props.locale)), 1)) : field.type === "derived" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_54$1, (0, vue.toDisplayString)(__props.render.derivedDisplay(field, __props.render.evaluateDerivedAgainstItem(field, String(key), detailRecord.value), detailRecord.value)), 1)) : field.type === "table" && field.of && __props.render.hasTableRows(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_55$1, [(0, vue.createElementVNode)("table", _hoisted_56$1, [(0, vue.createElementVNode)("thead", _hoisted_57$1, [(0, vue.createElementVNode)("tr", null, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.of, (subField, subKey) => {
1556
2436
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
1557
2437
  key: subKey,
1558
2438
  class: "text-left px-4 py-2 font-bold"
1559
2439
  }, (0, vue.toDisplayString)(subField.label), 1);
1560
- }), 128))])]), (0, vue.createElementVNode)("tbody", _hoisted_58, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.tableRows(detailRecord.value[key]), (row, rowIdx) => {
2440
+ }), 128))])]), (0, vue.createElementVNode)("tbody", _hoisted_58$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.render.tableRows(detailRecord.value[key]), (row, rowIdx) => {
1561
2441
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
1562
2442
  key: rowIdx,
1563
2443
  class: "hover:bg-slate-50/50"
@@ -1565,12 +2445,12 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1565
2445
  return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
1566
2446
  key: subKey,
1567
2447
  class: "px-4 py-2 align-middle font-medium"
1568
- }, [subField.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [row[subKey] === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_59, "check_circle")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_60, "—"))], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
2448
+ }, [subField.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [row[subKey] === true ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_59$1, "check_circle")) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_60$1, "—"))], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
1569
2449
  key: 1,
1570
2450
  class: (0, vue.normalizeClass)([subField.type === "money" ? "font-bold text-slate-800 tabular-nums" : ""])
1571
2451
  }, (0, vue.toDisplayString)(__props.render.formatSubCell(subField, row[subKey], detailRecord.value)), 3))]);
1572
2452
  }), 128))]);
1573
- }), 128))])])])) : field.type === "table" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_61, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noRows")), 1)) : field.type === "markdown" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_62, (0, vue.toDisplayString)(__props.render.detailText(detailRecord.value[key])), 1)) : field.type === "embed" && embedViews.value[key] ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionEmbedView_default, {
2453
+ }), 128))])])])) : field.type === "table" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_61$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noRows")), 1)) : field.type === "markdown" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_62$1, (0, vue.toDisplayString)(__props.render.detailText(detailRecord.value[key])), 1)) : field.type === "embed" && embedViews.value[key] ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionEmbedView_default, {
1574
2454
  key: 8,
1575
2455
  view: embedViews.value[key],
1576
2456
  "field-key": String(key)
@@ -1580,21 +2460,21 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1580
2460
  alt: field.label,
1581
2461
  class: "max-h-64 max-w-full object-contain rounded-lg border border-slate-200 bg-slate-50",
1582
2462
  "data-testid": `collections-detail-image-${key}`
1583
- }, null, 8, _hoisted_63)) : field.type !== "file" && __props.render.isExternalUrl(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
2463
+ }, null, 8, _hoisted_63$1)) : field.type !== "file" && __props.render.isExternalUrl(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
1584
2464
  key: 10,
1585
2465
  href: String(detailRecord.value[key]),
1586
2466
  target: "_blank",
1587
2467
  rel: "noopener noreferrer",
1588
2468
  class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
1589
2469
  "data-testid": `collections-detail-url-${key}`
1590
- }, (0, vue.toDisplayString)(String(detailRecord.value[key])), 9, _hoisted_64)) : field.type === "file" && __props.render.artifactUrl(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
2470
+ }, (0, vue.toDisplayString)(String(detailRecord.value[key])), 9, _hoisted_64$1)) : field.type === "file" && __props.render.artifactUrl(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
1591
2471
  key: 11,
1592
2472
  href: __props.render.artifactUrl(detailRecord.value[key]) ?? void 0,
1593
2473
  target: "_blank",
1594
2474
  rel: "noopener noreferrer",
1595
2475
  class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
1596
2476
  "data-testid": `collections-detail-file-${key}`
1597
- }, (0, vue.toDisplayString)(String(detailRecord.value[key])), 9, _hoisted_65)) : field.type === "file" && __props.render.fileRoutePath(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
2477
+ }, (0, vue.toDisplayString)(String(detailRecord.value[key])), 9, _hoisted_65$1)) : field.type === "file" && __props.render.fileRoutePath(detailRecord.value[key]) ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
1598
2478
  key: 12,
1599
2479
  to: __props.render.fileRoutePath(detailRecord.value[key]) ?? "",
1600
2480
  class: "text-blue-600 hover:text-blue-800 font-semibold hover:underline break-all",
@@ -1602,8 +2482,8 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1602
2482
  }, {
1603
2483
  default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(String(detailRecord.value[key])), 1)]),
1604
2484
  _: 2
1605
- }, 1032, ["to", "data-testid"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_66, (0, vue.toDisplayString)(__props.render.formatCell(detailRecord.value[key], field.type)), 1))], 8, _hoisted_47))], 2)) : (0, vue.createCommentVNode)("", true)], 64);
1606
- }), 128)), editing.value && __props.saveError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_67, (0, vue.toDisplayString)(__props.saveError), 1)) : (0, vue.createCommentVNode)("", true)])
2485
+ }, 1032, ["to", "data-testid"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_66$1, (0, vue.toDisplayString)(__props.render.formatCell(detailRecord.value[key], field.type)), 1))], 8, _hoisted_47$1))], 2)) : (0, vue.createCommentVNode)("", true)], 64);
2486
+ }), 128)), editing.value && __props.saveError ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_67$1, (0, vue.toDisplayString)(__props.saveError), 1)) : (0, vue.createCommentVNode)("", true)])
1607
2487
  ]),
1608
2488
  _: 1
1609
2489
  }, 40, ["data-testid"]);
@@ -1611,14 +2491,2231 @@ var CollectionRecordPanel_default = /* @__PURE__ */ (0, vue.defineComponent)({
1611
2491
  }
1612
2492
  });
1613
2493
  //#endregion
2494
+ //#region src/vue/components/CollectionViewConfigModal.vue?vue&type=script&setup=true&lang.ts
2495
+ var _hoisted_1$4 = {
2496
+ "data-testid": "collection-config-modal",
2497
+ class: "flex flex-col overflow-hidden"
2498
+ };
2499
+ var _hoisted_2$4 = { class: "flex items-center justify-between gap-2 border-b border-slate-100 px-5 py-3" };
2500
+ var _hoisted_3$4 = { class: "text-sm font-bold text-slate-700" };
2501
+ var _hoisted_4$4 = ["title", "aria-label"];
2502
+ var _hoisted_5$3 = { class: "overflow-y-auto px-5 py-4" };
2503
+ var _hoisted_6$3 = { class: "mb-2 text-[10px] font-bold uppercase tracking-wider text-slate-400" };
2504
+ var _hoisted_7$3 = {
2505
+ key: 0,
2506
+ class: "mb-3 rounded border border-rose-200 bg-rose-50 px-3 py-2 text-xs font-medium text-rose-600",
2507
+ "data-testid": "collection-config-error"
2508
+ };
2509
+ var _hoisted_8$3 = {
2510
+ key: 1,
2511
+ class: "flex flex-col gap-1"
2512
+ };
2513
+ var _hoisted_9$3 = { class: "material-icons text-base text-slate-400" };
2514
+ var _hoisted_10$3 = { class: "flex-1 truncate text-sm font-semibold text-slate-700" };
2515
+ var _hoisted_11$3 = [
2516
+ "title",
2517
+ "aria-label",
2518
+ "data-testid",
2519
+ "disabled",
2520
+ "onClick"
2521
+ ];
2522
+ var _hoisted_12$3 = {
2523
+ key: 2,
2524
+ class: "text-xs text-slate-400",
2525
+ "data-testid": "collection-config-empty"
2526
+ };
2527
+ //#endregion
2528
+ //#region src/vue/components/CollectionViewConfigModal.vue
2529
+ var CollectionViewConfigModal_default = /* @__PURE__ */ (0, vue.defineComponent)({
2530
+ __name: "CollectionViewConfigModal",
2531
+ props: {
2532
+ slug: {},
2533
+ title: {},
2534
+ views: {}
2535
+ },
2536
+ emits: ["close", "changed"],
2537
+ setup(__props, { emit: __emit }) {
2538
+ const props = __props;
2539
+ const emit = __emit;
2540
+ const { t } = useCollectionI18n();
2541
+ const deleting = (0, vue.ref)(null);
2542
+ const error = (0, vue.ref)(null);
2543
+ async function onDelete(view) {
2544
+ if (!await collectionUi().confirm({
2545
+ message: t("collectionsView.config.confirmDelete", { label: view.label }),
2546
+ confirmText: t("common.remove"),
2547
+ cancelText: t("common.cancel"),
2548
+ variant: "danger"
2549
+ })) return;
2550
+ error.value = null;
2551
+ deleting.value = view.id;
2552
+ try {
2553
+ const result = await collectionUi().deleteView(props.slug, view.id);
2554
+ if (!result.ok) {
2555
+ error.value = result.error;
2556
+ return;
2557
+ }
2558
+ emit("changed");
2559
+ } catch (err) {
2560
+ error.value = require_promptSafety.errorMessage(err);
2561
+ } finally {
2562
+ deleting.value = null;
2563
+ }
2564
+ }
2565
+ return (_ctx, _cache) => {
2566
+ return (0, vue.openBlock)(), (0, vue.createBlock)(CollectionRecordModal_default, { onClose: _cache[1] || (_cache[1] = ($event) => emit("close")) }, {
2567
+ default: (0, vue.withCtx)(() => [(0, vue.createElementVNode)("div", _hoisted_1$4, [(0, vue.createElementVNode)("header", _hoisted_2$4, [(0, vue.createElementVNode)("h2", _hoisted_3$4, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.config.title", { title: __props.title })), 1), (0, vue.createElementVNode)("button", {
2568
+ type: "button",
2569
+ class: "h-8 w-8 flex items-center justify-center rounded text-slate-400 hover:bg-slate-50 hover:text-slate-600",
2570
+ title: (0, vue.unref)(t)("common.close"),
2571
+ "aria-label": (0, vue.unref)(t)("common.close"),
2572
+ "data-testid": "collection-config-close",
2573
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
2574
+ }, [..._cache[2] || (_cache[2] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "close", -1)])], 8, _hoisted_4$4)]), (0, vue.createElementVNode)("div", _hoisted_5$3, [
2575
+ (0, vue.createElementVNode)("h3", _hoisted_6$3, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.config.viewsHeading")), 1),
2576
+ error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_7$3, (0, vue.toDisplayString)(error.value), 1)) : (0, vue.createCommentVNode)("", true),
2577
+ __props.views.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("ul", _hoisted_8$3, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(__props.views, (view) => {
2578
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("li", {
2579
+ key: view.id,
2580
+ class: "flex items-center gap-2 rounded border border-slate-200 bg-white px-3 py-2"
2581
+ }, [
2582
+ (0, vue.createElementVNode)("span", _hoisted_9$3, (0, vue.toDisplayString)(view.icon || "dashboard_customize"), 1),
2583
+ (0, vue.createElementVNode)("span", _hoisted_10$3, (0, vue.toDisplayString)(view.label), 1),
2584
+ (0, vue.createElementVNode)("button", {
2585
+ type: "button",
2586
+ class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 disabled:opacity-50",
2587
+ title: (0, vue.unref)(t)("collectionsView.config.deleteView", { label: view.label }),
2588
+ "aria-label": (0, vue.unref)(t)("collectionsView.config.deleteView", { label: view.label }),
2589
+ "data-testid": `collection-view-delete-${view.id}`,
2590
+ disabled: deleting.value !== null,
2591
+ onClick: ($event) => onDelete(view)
2592
+ }, [..._cache[3] || (_cache[3] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_11$3)
2593
+ ]);
2594
+ }), 128))])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("p", _hoisted_12$3, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.config.empty")), 1))
2595
+ ])])]),
2596
+ _: 1
2597
+ });
2598
+ };
2599
+ }
2600
+ });
2601
+ //#endregion
2602
+ //#region src/vue/components/CollectionCustomView.vue?vue&type=script&setup=true&lang.ts
2603
+ var _hoisted_1$3 = { class: "custom-view-container" };
2604
+ var _hoisted_2$3 = {
2605
+ key: 0,
2606
+ class: "custom-view-message",
2607
+ role: "alert",
2608
+ "data-testid": "collection-custom-view-error"
2609
+ };
2610
+ var _hoisted_3$3 = {
2611
+ key: 1,
2612
+ class: "custom-view-message",
2613
+ "data-testid": "collection-custom-view-loading"
2614
+ };
2615
+ var _hoisted_4$3 = ["title", "srcdoc"];
2616
+ var REMINT_LEAD_MS = 6e4;
2617
+ var MIN_REMINT_DELAY_MS = 1e4;
2618
+ var CollectionCustomView_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
2619
+ __name: "CollectionCustomView",
2620
+ props: {
2621
+ slug: {},
2622
+ view: {}
2623
+ },
2624
+ setup(__props) {
2625
+ const { t } = useCollectionI18n();
2626
+ const props = __props;
2627
+ const loading = (0, vue.ref)(true);
2628
+ const error = (0, vue.ref)(null);
2629
+ const srcdoc = (0, vue.ref)(null);
2630
+ let refreshTimer;
2631
+ function clearRefresh() {
2632
+ if (refreshTimer !== void 0) {
2633
+ clearTimeout(refreshTimer);
2634
+ refreshTimer = void 0;
2635
+ }
2636
+ }
2637
+ function scheduleRefresh(expMs) {
2638
+ clearRefresh();
2639
+ const delay = Math.max(expMs - Date.now() - REMINT_LEAD_MS, MIN_REMINT_DELAY_MS);
2640
+ refreshTimer = setTimeout(() => void load(), delay);
2641
+ }
2642
+ let loadSeq = 0;
2643
+ async function load() {
2644
+ clearRefresh();
2645
+ const seq = ++loadSeq;
2646
+ const stale = () => seq !== loadSeq;
2647
+ loading.value = true;
2648
+ error.value = null;
2649
+ srcdoc.value = null;
2650
+ const binding = collectionUi();
2651
+ try {
2652
+ const mint = await binding.mintViewToken(props.slug, props.view.id);
2653
+ if (stale()) return;
2654
+ if (!mint.ok) {
2655
+ error.value = mint.error;
2656
+ return;
2657
+ }
2658
+ scheduleRefresh(mint.data.exp);
2659
+ const resp = await binding.fetchViewHtml(props.slug, props.view.id);
2660
+ if (stale()) return;
2661
+ if (!resp.ok) {
2662
+ error.value = `HTTP ${resp.status}`;
2663
+ return;
2664
+ }
2665
+ srcdoc.value = binding.buildViewSrcdoc(resp.html, {
2666
+ slug: props.slug,
2667
+ token: mint.data.token,
2668
+ dataUrl: mint.data.dataUrl,
2669
+ origin: window.location.origin
2670
+ });
2671
+ } catch (err) {
2672
+ if (!stale()) error.value = require_promptSafety.errorMessage(err);
2673
+ } finally {
2674
+ if (!stale()) loading.value = false;
2675
+ }
2676
+ }
2677
+ (0, vue.watch)([() => props.slug, () => props.view.id], () => void load(), { immediate: true });
2678
+ (0, vue.onBeforeUnmount)(clearRefresh);
2679
+ return (_ctx, _cache) => {
2680
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$3, [error.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_2$3, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.customViewError", { error: error.value })), 1)) : loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_3$3, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.customViewLoading")), 1)) : srcdoc.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("iframe", {
2681
+ key: __props.view.id,
2682
+ "data-testid": "collection-custom-view-iframe",
2683
+ title: __props.view.label,
2684
+ srcdoc: srcdoc.value,
2685
+ sandbox: "allow-scripts allow-popups allow-popups-to-escape-sandbox",
2686
+ class: "w-full h-full border-0"
2687
+ }, null, 8, _hoisted_4$3)) : (0, vue.createCommentVNode)("", true)]);
2688
+ };
2689
+ }
2690
+ });
2691
+ //#endregion
2692
+ //#region \0plugin-vue:export-helper
2693
+ var _plugin_vue_export_helper_default = (sfc, props) => {
2694
+ const target = sfc.__vccOpts || sfc;
2695
+ for (const [key, val] of props) target[key] = val;
2696
+ return target;
2697
+ };
2698
+ //#endregion
2699
+ //#region src/vue/components/CollectionCustomView.vue
2700
+ var CollectionCustomView_default = /* @__PURE__ */ _plugin_vue_export_helper_default(CollectionCustomView_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-3ab71997"]]);
2701
+ //#endregion
2702
+ //#region src/vue/components/CollectionView.vue?vue&type=script&setup=true&lang.ts
2703
+ var _hoisted_1$2 = { class: "h-full flex flex-col bg-slate-50/30" };
2704
+ var _hoisted_2$2 = { class: "flex items-center gap-3 px-6 py-2 border-b border-slate-200 bg-white" };
2705
+ var _hoisted_3$2 = ["title", "aria-label"];
2706
+ var _hoisted_4$2 = {
2707
+ key: 1,
2708
+ class: "h-9 w-9 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100"
2709
+ };
2710
+ var _hoisted_5$2 = { class: "material-symbols-outlined text-xl" };
2711
+ var _hoisted_6$2 = { class: "flex-1 min-w-0" };
2712
+ var _hoisted_7$2 = { class: "text-base font-bold text-slate-800 truncate" };
2713
+ var _hoisted_8$2 = {
2714
+ key: 0,
2715
+ class: "block text-[10px] text-slate-400 font-bold uppercase tracking-wider"
2716
+ };
2717
+ var _hoisted_9$2 = ["disabled"];
2718
+ var _hoisted_10$2 = { class: "material-icons text-sm" };
2719
+ var _hoisted_11$2 = [
2720
+ "disabled",
2721
+ "data-testid",
2722
+ "onClick"
2723
+ ];
2724
+ var _hoisted_12$2 = {
2725
+ key: 0,
2726
+ class: "material-icons text-sm"
2727
+ };
2728
+ var _hoisted_13$2 = ["title", "aria-label"];
2729
+ var _hoisted_14$2 = ["title", "aria-label"];
2730
+ var _hoisted_15$2 = {
2731
+ key: 0,
2732
+ class: "px-6 py-3 bg-white border-b border-slate-100 flex items-center justify-between gap-4"
2733
+ };
2734
+ var _hoisted_16$1 = {
2735
+ key: 0,
2736
+ class: "relative flex-1 max-w-md"
2737
+ };
2738
+ var _hoisted_17$1 = ["placeholder", "aria-label"];
2739
+ var _hoisted_18$1 = ["aria-label"];
2740
+ var _hoisted_19$1 = { class: "flex items-center gap-2" };
2741
+ var _hoisted_20$1 = ["aria-label"];
2742
+ var _hoisted_21$1 = ["aria-pressed"];
2743
+ var _hoisted_22$1 = ["aria-pressed"];
2744
+ var _hoisted_23$1 = ["aria-pressed"];
2745
+ var _hoisted_24 = [
2746
+ "aria-pressed",
2747
+ "data-testid",
2748
+ "onClick"
2749
+ ];
2750
+ var _hoisted_25 = { class: "material-icons text-sm" };
2751
+ var _hoisted_26 = ["title", "aria-label"];
2752
+ var _hoisted_27 = ["title", "aria-label"];
2753
+ var _hoisted_28 = ["value", "aria-label"];
2754
+ var _hoisted_29 = ["value"];
2755
+ var _hoisted_30 = ["value", "aria-label"];
2756
+ var _hoisted_31 = ["value"];
2757
+ var _hoisted_32 = {
2758
+ key: 3,
2759
+ class: "text-[10px] text-slate-400 font-bold uppercase tracking-wider select-none"
2760
+ };
2761
+ var _hoisted_33 = {
2762
+ key: 1,
2763
+ class: "mx-6 mt-4 rounded-xl border border-amber-200 bg-amber-50/60 p-4 text-sm text-amber-900 shadow-sm flex items-center gap-3",
2764
+ "data-testid": "collections-data-issues"
2765
+ };
2766
+ var _hoisted_34 = { class: "flex-1" };
2767
+ var _hoisted_35 = { class: "flex-1 overflow-auto" };
2768
+ var _hoisted_36 = {
2769
+ key: 0,
2770
+ class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
2771
+ };
2772
+ var _hoisted_37 = {
2773
+ key: 1,
2774
+ class: "m-6 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
2775
+ };
2776
+ var _hoisted_38 = { key: 2 };
2777
+ var _hoisted_39 = {
2778
+ key: 3,
2779
+ class: "p-4"
2780
+ };
2781
+ var _hoisted_40 = {
2782
+ key: 4,
2783
+ class: "h-full flex flex-col"
2784
+ };
2785
+ var _hoisted_41 = {
2786
+ key: 0,
2787
+ class: "m-3 mb-0 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3",
2788
+ "data-testid": "collections-inline-error"
2789
+ };
2790
+ var _hoisted_42 = { class: "flex-1" };
2791
+ var _hoisted_43 = ["aria-label"];
2792
+ var _hoisted_44 = { class: "flex-1 min-h-0 px-3 py-2" };
2793
+ var _hoisted_45 = {
2794
+ key: 5,
2795
+ class: "h-full",
2796
+ "data-testid": "collection-custom-view-body"
2797
+ };
2798
+ var _hoisted_46 = {
2799
+ key: 6,
2800
+ class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
2801
+ };
2802
+ var _hoisted_47 = { class: "font-semibold text-slate-600" };
2803
+ var _hoisted_48 = {
2804
+ key: 7,
2805
+ class: "flex flex-col items-center justify-center py-20 text-sm text-slate-400 gap-2"
2806
+ };
2807
+ var _hoisted_49 = { class: "font-semibold text-slate-600" };
2808
+ var _hoisted_50 = {
2809
+ key: 8,
2810
+ class: "overflow-x-auto [container-type:inline-size]"
2811
+ };
2812
+ var _hoisted_51 = {
2813
+ key: 0,
2814
+ class: "m-4 rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3",
2815
+ "data-testid": "collections-inline-error"
2816
+ };
2817
+ var _hoisted_52 = { class: "flex-1" };
2818
+ var _hoisted_53 = ["aria-label"];
2819
+ var _hoisted_54 = { class: "min-w-full text-xs" };
2820
+ var _hoisted_55 = { class: "bg-slate-50 border-b border-slate-200" };
2821
+ var _hoisted_56 = ["aria-sort"];
2822
+ var _hoisted_57 = { class: "flex items-center gap-1" };
2823
+ var _hoisted_58 = ["title"];
2824
+ var _hoisted_59 = [
2825
+ "data-testid",
2826
+ "aria-label",
2827
+ "onClick",
2828
+ "onPointerenter"
2829
+ ];
2830
+ var _hoisted_60 = { class: "material-icons text-base align-middle" };
2831
+ var _hoisted_61 = { class: "divide-y divide-slate-100 bg-white" };
2832
+ var _hoisted_62 = [
2833
+ "aria-label",
2834
+ "data-testid",
2835
+ "onClick",
2836
+ "onKeydown"
2837
+ ];
2838
+ var _hoisted_63 = [
2839
+ "checked",
2840
+ "disabled",
2841
+ "data-testid",
2842
+ "aria-label",
2843
+ "onChange"
2844
+ ];
2845
+ var _hoisted_64 = [
2846
+ "checked",
2847
+ "disabled",
2848
+ "data-testid",
2849
+ "aria-label",
2850
+ "onChange"
2851
+ ];
2852
+ var _hoisted_65 = {
2853
+ key: 2,
2854
+ class: "block truncate"
2855
+ };
2856
+ var _hoisted_66 = [
2857
+ "value",
2858
+ "disabled",
2859
+ "data-testid",
2860
+ "aria-label",
2861
+ "onChange"
2862
+ ];
2863
+ var _hoisted_67 = {
2864
+ key: 0,
2865
+ value: ""
2866
+ };
2867
+ var _hoisted_68 = ["value"];
2868
+ var _hoisted_69 = {
2869
+ key: 4,
2870
+ class: "block truncate tabular-nums font-semibold text-slate-900"
2871
+ };
2872
+ var _hoisted_70 = {
2873
+ key: 5,
2874
+ class: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg text-[10px] font-bold bg-slate-100 text-slate-600 border border-slate-200/40"
2875
+ };
2876
+ var _hoisted_71 = {
2877
+ key: 6,
2878
+ class: "inline-block truncate tabular-nums font-bold text-indigo-900 bg-indigo-50/50 px-1.5 py-0.5 rounded border border-indigo-100/50"
2879
+ };
2880
+ var _hoisted_72 = ["href", "data-testid"];
2881
+ var _hoisted_73 = ["href", "data-testid"];
2882
+ var _hoisted_74 = {
2883
+ key: 10,
2884
+ class: "block truncate text-slate-600"
2885
+ };
2886
+ var _hoisted_75 = { class: "bg-white rounded-2xl shadow-2xl w-full max-w-xl flex flex-col border border-slate-200 overflow-hidden" };
2887
+ var _hoisted_76 = { class: "px-6 py-4 border-b border-slate-100 flex items-center gap-3 bg-slate-50/50" };
2888
+ var _hoisted_77 = { class: "flex-1" };
2889
+ var _hoisted_78 = {
2890
+ id: "collections-chat-title",
2891
+ class: "text-sm font-bold text-slate-800 uppercase tracking-wide"
2892
+ };
2893
+ var _hoisted_79 = { class: "text-xs text-slate-400 font-semibold" };
2894
+ var _hoisted_80 = ["aria-label"];
2895
+ var _hoisted_81 = { class: "px-6 py-5" };
2896
+ var _hoisted_82 = ["placeholder", "onKeydown"];
2897
+ var _hoisted_83 = { class: "px-6 py-3.5 border-t border-slate-100 flex items-center justify-end gap-2 bg-slate-50/50" };
2898
+ var _hoisted_84 = ["disabled"];
2899
+ //#endregion
2900
+ //#region src/vue/components/CollectionView.vue
2901
+ var CollectionView_default = /* @__PURE__ */ (0, vue.defineComponent)({
2902
+ __name: "CollectionView",
2903
+ props: {
2904
+ slug: {},
2905
+ selected: {},
2906
+ sendTextMessage: { type: Function },
2907
+ initialView: {},
2908
+ initialAnchorField: {},
2909
+ initialGroupField: {}
2910
+ },
2911
+ emits: ["select", "viewStateChange"],
2912
+ setup(__props, { emit: __emit }) {
2913
+ const props = __props;
2914
+ const emit = __emit;
2915
+ const { t, locale } = useCollectionI18n();
2916
+ const cui = collectionUi();
2917
+ const { confirm: openConfirm, unpin, pinToggle, startChat } = cui;
2918
+ const appApi = { startNewChat: startChat };
2919
+ /** Embedded when a `slug` prop is supplied; standalone (route-driven)
2920
+ * otherwise. Switches the slug/selected source and the open/close
2921
+ * navigation behaviour. */
2922
+ const embedded = (0, vue.computed)(() => props.slug !== void 0);
2923
+ /** Active collection slug: the prop in embedded mode, else the route
2924
+ * param. */
2925
+ const activeSlug = (0, vue.computed)(() => {
2926
+ if (props.slug !== void 0) return props.slug;
2927
+ const slug = cui.routeSlug();
2928
+ return slug !== void 0 && slug.length > 0 ? slug : void 0;
2929
+ });
2930
+ /** Active open-record id: the prop in embedded mode (may be undefined),
2931
+ * else the `?selected=` query. */
2932
+ const activeSelected = (0, vue.computed)(() => {
2933
+ if (embedded.value) return props.selected;
2934
+ return cui.routeSelectedId();
2935
+ });
2936
+ const collection = (0, vue.ref)(null);
2937
+ const items = (0, vue.ref)([]);
2938
+ const loading = (0, vue.ref)(true);
2939
+ const loadError = (0, vue.ref)(null);
2940
+ const dataIssues = (0, vue.ref)([]);
2941
+ const notifiedSeverities = (0, vue.computed)(() => {
2942
+ const slug = collection.value?.slug;
2943
+ return slug ? cui.notifiedSeverities(slug) : /* @__PURE__ */ new Map();
2944
+ });
2945
+ /** True while a feed collection's manual refresh is in flight. */
2946
+ const refreshing = (0, vue.ref)(false);
2947
+ /** Slug already auto-refreshed on first open — prevents a reload loop
2948
+ * (the auto-refresh reloads the view, which would re-trigger otherwise). */
2949
+ const autoRefreshedSlug = (0, vue.ref)(null);
2950
+ const editing = (0, vue.ref)(null);
2951
+ /** The record currently shown in read-only "open" mode. Distinct
2952
+ * from `editing`: open mode renders formatted values (no inputs)
2953
+ * and is what a `/collections/<slug>?selected=<id>` deep link
2954
+ * lands on. Mutually exclusive with `editing` in practice —
2955
+ * `editFromView` hands off from one to the other. */
2956
+ const viewing = (0, vue.ref)(null);
2957
+ /** The calendar day whose time-allocation popup is open, or null. The
2958
+ * selected record (`viewing`) renders in that popup's right pane; a record
2959
+ * with no resolvable day falls back to the panel below the grid. */
2960
+ const openDay = (0, vue.ref)(null);
2961
+ const saving = (0, vue.ref)(false);
2962
+ const saveError = (0, vue.ref)(null);
2963
+ /** Error from an inline table-cell edit (checkbox/dropdown). Distinct
2964
+ * from `saveError` (rendered only inside the detail panel, which is
2965
+ * closed during inline editing) — shown as a banner above the table. */
2966
+ const inlineError = (0, vue.ref)(null);
2967
+ /** Per-load snapshot of enum cells that had NO value when fetched
2968
+ * (keyed `<rowId>:<fieldKey>`). Only these cells offer the empty
2969
+ * placeholder option in their inline dropdown — a cell that already
2970
+ * has a value can't be blanked inline (use the edit form for that). */
2971
+ const enumOriginallyEmpty = (0, vue.ref)(/* @__PURE__ */ new Set());
2972
+ /** Rows with an inline cell save in flight (by `rowId`). While a row is
2973
+ * here its inline controls are disabled, so two quick edits to the same
2974
+ * row can't race two full-record PUTs — an older PUT landing last would
2975
+ * otherwise clobber the newer field on disk while the UI shows the
2976
+ * newer optimistic value (Codex PR #1599 P2). */
2977
+ const inlineSavingRows = (0, vue.ref)(/* @__PURE__ */ new Set());
2978
+ const actionPending = (0, vue.ref)(false);
2979
+ const actionError = (0, vue.ref)(null);
2980
+ const collectionActionPending = (0, vue.ref)(false);
2981
+ const chatOpen = (0, vue.ref)(false);
2982
+ const chatMessage = (0, vue.ref)("");
2983
+ const chatInputEl = (0, vue.ref)(null);
2984
+ const render = useCollectionRendering(collection, locale);
2985
+ const { refRecordCache, refDisplay, formatMoney, resolveCurrency, derivedDisplay, evaluateDerivedAgainstItem, formatCell, isExternalUrl, artifactUrl, fileRoutePath } = render;
2986
+ const searchQuery = (0, vue.ref)("");
2987
+ /** Case-insensitive substring match across an item's scalar fields.
2988
+ * Object-valued fields (table rows, nested records) are skipped —
2989
+ * they don't render as searchable text in the list table. */
2990
+ function itemMatchesQuery(item, query) {
2991
+ return Object.values(item).some((val) => {
2992
+ if (val === void 0 || val === null || typeof val === "object") return false;
2993
+ return String(val).toLowerCase().includes(query);
2994
+ });
2995
+ }
2996
+ const filteredItems = (0, vue.computed)(() => {
2997
+ const query = searchQuery.value.trim().toLowerCase();
2998
+ if (!query) return items.value;
2999
+ return items.value.filter((item) => itemMatchesQuery(item, query));
3000
+ });
3001
+ function storedSortFor(slug) {
3002
+ return slug && readCollectionSort(slug) || null;
3003
+ }
3004
+ const sortState = (0, vue.ref)(storedSortFor(activeSlug.value));
3005
+ const hoveredSortKey = (0, vue.ref)(null);
3006
+ function sortDirectionFor(key) {
3007
+ return sortState.value?.field === key ? sortState.value.direction : null;
3008
+ }
3009
+ /** The direction whose visuals to render: on hover, preview the next
3010
+ * click's state; otherwise show the column's actual state. */
3011
+ function effectiveSortDir(key) {
3012
+ const current = sortDirectionFor(key);
3013
+ return hoveredSortKey.value === key ? require_promptSafety.nextSortDirection(current) : current;
3014
+ }
3015
+ /** Cycle a column none → asc → desc → none; activating one clears the rest. */
3016
+ function cycleSort(key) {
3017
+ const next = require_promptSafety.nextSortDirection(sortDirectionFor(key));
3018
+ sortState.value = next ? {
3019
+ field: key,
3020
+ direction: next
3021
+ } : null;
3022
+ }
3023
+ function sortIconName(key) {
3024
+ return effectiveSortDir(key) === "desc" ? "arrow_downward" : "arrow_upward";
3025
+ }
3026
+ function sortButtonClass(key) {
3027
+ return effectiveSortDir(key) ? "text-slate-600" : "text-slate-300";
3028
+ }
3029
+ /** ARIA `aria-sort` token for a column's header cell. */
3030
+ function sortAriaValue(key) {
3031
+ const dir = sortDirectionFor(key);
3032
+ return dir === "asc" ? "ascending" : dir === "desc" ? "descending" : "none";
3033
+ }
3034
+ /** Comparable value for scalar fields that key off the raw cell value. */
3035
+ function scalarSortValue(field, raw) {
3036
+ switch (field.type) {
3037
+ case "number":
3038
+ case "money": return require_promptSafety.numericSortValue(raw);
3039
+ case "date":
3040
+ case "datetime": return require_promptSafety.dateSortValue(raw);
3041
+ case "enum": return require_promptSafety.enumSortValue(field.values, raw);
3042
+ case "boolean": return require_promptSafety.boolSortValue(raw === true);
3043
+ case "ref": return field.to && typeof raw === "string" && raw ? require_promptSafety.stringSortValue(refDisplay(field.to, raw)) : require_promptSafety.stringSortValue(raw);
3044
+ default: return require_promptSafety.stringSortValue(raw);
3045
+ }
3046
+ }
3047
+ /** Comparable value for one row under the active field. Toggle and derived
3048
+ * need the whole record; every other type keys off the raw cell. */
3049
+ function sortValueOf(field, key, item) {
3050
+ if (field.type === "toggle") return require_promptSafety.boolSortValue(toggleChecked(item, field));
3051
+ if (field.type === "derived") return derivedSortValue(field, key, item);
3052
+ return scalarSortValue(field, item[key]);
3053
+ }
3054
+ /** Derived rows sort by their display type: money/number → numeric,
3055
+ * date/datetime → epoch, anything else → the enriched value as a string. */
3056
+ function derivedSortValue(field, key, item) {
3057
+ const { display } = field;
3058
+ if (display === void 0 || display === "number" || display === "money") return require_promptSafety.numericSortValue(evaluateDerivedAgainstItem(field, key, item));
3059
+ const enriched = collection.value ? render.deriveAll(collection.value.schema, item, render.refRecordCache.value) : item;
3060
+ if (display === "date" || display === "datetime") return require_promptSafety.dateSortValue(enriched[key]);
3061
+ return require_promptSafety.stringSortValue(enriched[key]);
3062
+ }
3063
+ const sortedItems = (0, vue.computed)(() => {
3064
+ const state = sortState.value;
3065
+ const field = state ? collection.value?.schema.fields[state.field] : void 0;
3066
+ if (!state || !field) return filteredItems.value;
3067
+ return require_promptSafety.sortItems(filteredItems.value, state.direction, (item) => sortValueOf(field, state.field, item));
3068
+ });
3069
+ /** Stringified primary-key value for a row (the row's stable identity). */
3070
+ function rowId(item) {
3071
+ const primaryKey = collection.value?.schema.primaryKey;
3072
+ return primaryKey ? String(item[primaryKey] ?? "") : "";
3073
+ }
3074
+ /** Stable key for one cell in the `enumOriginallyEmpty` snapshot. */
3075
+ function cellKey(rowIdValue, fieldKey) {
3076
+ return `${rowIdValue}:${fieldKey}`;
3077
+ }
3078
+ /** Build the set of enum cells that were empty in the freshly-fetched
3079
+ * records — the only cells whose inline dropdown offers an empty option. */
3080
+ function snapshotEmptyEnums(schema, records) {
3081
+ const empty = /* @__PURE__ */ new Set();
3082
+ const enumKeys = Object.entries(schema.fields).filter(([, field]) => field.type === "enum").map(([fieldKey]) => fieldKey);
3083
+ if (enumKeys.length === 0) return empty;
3084
+ for (const record of records) {
3085
+ const recordId = String(record[schema.primaryKey] ?? "");
3086
+ for (const fieldKey of enumKeys) if (record[fieldKey] == null || record[fieldKey] === "") empty.add(cellKey(recordId, fieldKey));
3087
+ }
3088
+ return empty;
3089
+ }
3090
+ /** Whether an inline enum dropdown should render its empty placeholder
3091
+ * option: only for cells with no value at load time. */
3092
+ function showEnumPlaceholder(item, fieldKey) {
3093
+ return enumOriginallyEmpty.value.has(cellKey(rowId(item), fieldKey));
3094
+ }
3095
+ /** Tailwind fill/text/border classes tinting an inline enum `<select>` by its
3096
+ * current value's colour (palette, or notification red/amber/grey when the
3097
+ * field is the schema's notifyWhen target). */
3098
+ function enumControlClass(fieldKey, value) {
3099
+ const schema = collection.value?.schema;
3100
+ if (!schema) return "";
3101
+ const cls = require_promptSafety.resolveEnumColor(schema, fieldKey, value);
3102
+ return `${cls.badge} ${cls.border}`;
3103
+ }
3104
+ /** This row is the one open in read-only detail. */
3105
+ function isRowOpen(item) {
3106
+ return viewing.value !== null && rowId(viewing.value) === rowId(item);
3107
+ }
3108
+ /** This row is the one being edited (highlights it in the list while the
3109
+ * edit modal is open). Create mode has no backing row, so nothing matches. */
3110
+ function isEditingRow(item) {
3111
+ const draft = editing.value;
3112
+ if (!draft || draft.mode === "create") return false;
3113
+ return draft.originalId === rowId(item);
3114
+ }
3115
+ /** Re-run a feed collection's retrieval now, then reload its records.
3116
+ * Only reachable when `schema.ingest` is present (button is gated). */
3117
+ async function refreshFeed() {
3118
+ const current = collection.value;
3119
+ if (!current?.schema.ingest || refreshing.value) return;
3120
+ refreshing.value = true;
3121
+ inlineError.value = null;
3122
+ const result = await cui.refreshCollection(current.slug);
3123
+ refreshing.value = false;
3124
+ if (!result.ok) {
3125
+ loadError.value = result.error;
3126
+ return;
3127
+ }
3128
+ await loadCollection(current.slug);
3129
+ if (result.data.errors.length > 0) inlineError.value = t("collectionsView.refreshFailed", { error: result.data.errors.join("; ") });
3130
+ }
3131
+ /** Collection-level header actions. No `when` predicate (no record). */
3132
+ const collectionActions = (0, vue.computed)(() => collection.value?.schema.collectionActions ?? []);
3133
+ /** Run a collection-level action: ask the server to assemble the seed
3134
+ * prompt (a progress summary of all records + the template), then start
3135
+ * a new chat in the action's role with it. Generic — no domain knowledge. */
3136
+ async function runCollectionAction(action) {
3137
+ const current = collection.value;
3138
+ if (!current || collectionActionPending.value) return;
3139
+ collectionActionPending.value = true;
3140
+ inlineError.value = null;
3141
+ const result = await cui.runCollectionAction(current.slug, action.id);
3142
+ collectionActionPending.value = false;
3143
+ if (!result.ok) {
3144
+ inlineError.value = result.error;
3145
+ return;
3146
+ }
3147
+ if (props.sendTextMessage) {
3148
+ props.sendTextMessage(result.data.prompt);
3149
+ return;
3150
+ }
3151
+ appApi.startNewChat(result.data.prompt, result.data.role);
3152
+ }
3153
+ /** Report the server-detected record data problems back to the LLM so it
3154
+ * fixes the offending files. Mirrors the `presentCollection` validation
3155
+ * path (`dispatchPresentCollection`), but user-initiated via the Repair
3156
+ * button instead of fired automatically after a write. Dispatches into
3157
+ * the current chat when embedded, else seeds a new General chat. */
3158
+ function repairCollection() {
3159
+ const current = collection.value;
3160
+ if (!current || dataIssues.value.length === 0) return;
3161
+ const lines = dataIssues.value.map((issue) => `- ${require_promptSafety.defangForPrompt(issue.file)}: ${require_promptSafety.defangForPrompt(issue.problem)}`).join("\n");
3162
+ const prompt = t("collectionsView.repairPrompt", {
3163
+ title: current.title,
3164
+ count: dataIssues.value.length,
3165
+ issues: lines
3166
+ });
3167
+ if (props.sendTextMessage) {
3168
+ props.sendTextMessage(prompt);
3169
+ return;
3170
+ }
3171
+ appApi.startNewChat(prompt, cui.generalRoleId);
3172
+ }
3173
+ /** Actions whose optional `when` predicate matches the open record.
3174
+ * Status-driven buttons (e.g. invoice "Record payment") stay hidden
3175
+ * until the record reaches the matching state. */
3176
+ const visibleActions = (0, vue.computed)(() => {
3177
+ const record = viewing.value;
3178
+ if (!record) return [];
3179
+ return (collection.value?.schema.actions ?? []).filter((action) => require_promptSafety.actionVisible(action, record));
3180
+ });
3181
+ /** Run a schema-declared action on the open record: ask the server to
3182
+ * assemble the seed prompt, then start a new chat in the action's
3183
+ * role with it. Generic — no knowledge of what the action does. */
3184
+ async function runAction(action) {
3185
+ if (!collection.value || !viewing.value) return;
3186
+ const itemId = String(viewing.value[collection.value.schema.primaryKey] ?? "");
3187
+ if (!itemId) return;
3188
+ actionPending.value = true;
3189
+ actionError.value = null;
3190
+ const result = await cui.runItemAction(collection.value.slug, itemId, action.id);
3191
+ actionPending.value = false;
3192
+ if (!result.ok) {
3193
+ actionError.value = result.error;
3194
+ return;
3195
+ }
3196
+ if (props.sendTextMessage) {
3197
+ props.sendTextMessage(result.data.prompt);
3198
+ return;
3199
+ }
3200
+ appApi.startNewChat(result.data.prompt, result.data.role);
3201
+ }
3202
+ /** Open the chat modal, blanking any prior draft and focusing the input. */
3203
+ function openChat() {
3204
+ chatMessage.value = "";
3205
+ chatOpen.value = true;
3206
+ (0, vue.nextTick)(() => chatInputEl.value?.focus());
3207
+ }
3208
+ function closeChat() {
3209
+ chatOpen.value = false;
3210
+ }
3211
+ /** Build the chat seed text for the current view.
3212
+ *
3213
+ * A collection IS a skill, so its slug doubles as a slash command:
3214
+ * "I want to create an item" on `mc_worklog` becomes
3215
+ * `/mc_worklog I want to create an item`.
3216
+ *
3217
+ * A feed is data-only — it has NO skill, so `/<slug>` would resolve to
3218
+ * nothing. Instead, point the agent at the feed's schema + records
3219
+ * (`feeds/<slug>/schema.json` and `<dataPath>/`) and let it act on the
3220
+ * request directly. */
3221
+ function buildChatSeed(slug, message) {
3222
+ const schema = collection.value?.schema;
3223
+ if (!schema?.ingest) return `/${slug} ${message}`;
3224
+ return t("collectionsView.feedChatSeed", {
3225
+ slug,
3226
+ dataPath: schema.dataPath ?? `data/feeds/${slug}`,
3227
+ message
3228
+ });
3229
+ }
3230
+ /** Start a new general-role chat seeded from the current view. */
3231
+ function submitChat() {
3232
+ if (!collection.value) return;
3233
+ const message = chatMessage.value.trim();
3234
+ if (!message) return;
3235
+ closeChat();
3236
+ const text = buildChatSeed(collection.value.slug, message);
3237
+ if (props.sendTextMessage) {
3238
+ props.sendTextMessage(text);
3239
+ return;
3240
+ }
3241
+ appApi.startNewChat(text, cui.generalRoleId);
3242
+ }
3243
+ async function loadCollection(slug) {
3244
+ const requestedKind = !embedded.value && cui.isFeedRoute() ? "feed" : "collection";
3245
+ loading.value = true;
3246
+ loadError.value = null;
3247
+ collection.value = null;
3248
+ items.value = [];
3249
+ dataIssues.value = [];
3250
+ searchQuery.value = "";
3251
+ render.resetLinkedCaches();
3252
+ viewing.value = null;
3253
+ openDay.value = null;
3254
+ const result = await cui.fetchCollectionDetail(slug);
3255
+ loading.value = false;
3256
+ if (!result.ok) {
3257
+ loadError.value = result.status === 404 ? "not-found" : result.error;
3258
+ if (result.status === 404 && !embedded.value && activeSlug.value === slug) unpin(requestedKind, slug);
3259
+ return;
3260
+ }
3261
+ collection.value = result.data.collection;
3262
+ items.value = result.data.items;
3263
+ dataIssues.value = result.data.issues ?? [];
3264
+ enumOriginallyEmpty.value = snapshotEmptyEnums(result.data.collection.schema, result.data.items);
3265
+ await render.loadLinkedCollections(result.data.collection.schema, slug);
3266
+ if (collection.value?.slug === slug) {
3267
+ syncViewToSelected();
3268
+ maybeOpenCalendarForSelected();
3269
+ }
3270
+ maybeAutoRefreshFeed(slug);
3271
+ }
3272
+ function maybeAutoRefreshFeed(slug) {
3273
+ if (embedded.value) return;
3274
+ const current = collection.value;
3275
+ if (current?.slug !== slug || !current.schema.ingest) return;
3276
+ if (items.value.length > 0 || autoRefreshedSlug.value === slug) return;
3277
+ autoRefreshedSlug.value = slug;
3278
+ refreshFeed();
3279
+ }
3280
+ /** Schema fields excluding display-only `embed` fields — used by the
3281
+ * list table only (a whole embedded record doesn't fit a table cell,
3282
+ * and it'd be identical in every row). The detail modal and the edit
3283
+ * form iterate the full `schema.fields` so embeds render there too. */
3284
+ const listColumnFields = (0, vue.computed)(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([key, field]) => field.type !== "embed" && field.type !== "image" && key !== collection.value?.schema.primaryKey) : []);
3285
+ /** True when the current collection declares `schema.singleton` —
3286
+ * exactly one record, its primary key fixed to the declared value. */
3287
+ const isSingleton = (0, vue.computed)(() => Boolean(collection.value?.schema.singleton));
3288
+ /** Whether the Add button should show. Always for a normal collection;
3289
+ * for a singleton only until its one record exists. */
3290
+ const canCreate = (0, vue.computed)(() => {
3291
+ if (!collection.value) return false;
3292
+ return !(isSingleton.value && items.value.length > 0);
3293
+ });
3294
+ const canDeleteCollection = (0, vue.computed)(() => {
3295
+ const current = collection.value;
3296
+ if (!current) return false;
3297
+ return current.source === "project" && !current.slug.startsWith("mc-");
3298
+ });
3299
+ const isFeed = (0, vue.computed)(() => Boolean(collection.value?.schema.ingest));
3300
+ const canDeleteFeed = (0, vue.computed)(() => isFeed.value && !embedded.value);
3301
+ const isFeedRoute = (0, vue.computed)(() => !embedded.value && cui.isFeedRoute());
3302
+ /** The view to open with: the embedded card's restored `initialView` if
3303
+ * present (its own persisted state wins), else the slug's stored
3304
+ * preference, else "table". Embedded cards READ the store but never WRITE
3305
+ * it (the persist watch only emits `viewStateChange` for them), so a stale
3306
+ * card re-rendering can't clobber the shared preference. */
3307
+ function initialViewMode() {
3308
+ if (props.initialView) return props.initialView;
3309
+ const slug = activeSlug.value;
3310
+ return slug && readCollectionViewMode(slug) || "table";
3311
+ }
3312
+ const view = (0, vue.ref)(initialViewMode());
3313
+ /** `date` / `datetime` fields in declaration order — the calendar can anchor
3314
+ * on any (a `datetime` anchor also carries the clock for the day view). */
3315
+ const dateFields = (0, vue.computed)(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([, field]) => field.type === "date" || field.type === "datetime").map(([key]) => key) : []);
3316
+ /** Whether the table ↔ calendar toggle is offered. */
3317
+ const hasCalendar = (0, vue.computed)(() => dateFields.value.length > 0);
3318
+ /** `enum` fields in declaration order — the kanban can group on any. */
3319
+ const enumFields = (0, vue.computed)(() => collection.value ? Object.entries(collection.value.schema.fields).filter(([, field]) => field.type === "enum").map(([key]) => key) : []);
3320
+ /** Whether the kanban toggle is offered (needs an `enum` field to group on). */
3321
+ const hasKanban = (0, vue.computed)(() => enumFields.value.length > 0);
3322
+ /** The effective view, collapsing any stale mode whose enabling field
3323
+ * vanished (e.g. `view = "kanban"` after switching to an enum-less
3324
+ * collection) back to "table". Single source of truth for the toggle and
3325
+ * the body branches. */
3326
+ /** Custom (LLM-authored) HTML views declared on the schema. */
3327
+ const customViews = (0, vue.computed)(() => collection.value?.schema.views ?? []);
3328
+ const hasCustomViews = (0, vue.computed)(() => customViews.value.length > 0);
3329
+ const activeView = (0, vue.computed)(() => {
3330
+ if (view.value === "calendar" && hasCalendar.value) return "calendar";
3331
+ if (view.value === "kanban" && hasKanban.value) return "kanban";
3332
+ if (view.value.startsWith("custom:")) {
3333
+ const viewId = view.value.slice(7);
3334
+ if (customViews.value.some((entry) => entry.id === viewId)) return view.value;
3335
+ }
3336
+ return "table";
3337
+ });
3338
+ /** The selected custom view's spec, or null when a built-in view is active. */
3339
+ const activeCustomView = (0, vue.computed)(() => {
3340
+ const mode = activeView.value;
3341
+ if (!mode.startsWith("custom:")) return null;
3342
+ const viewId = mode.slice(7);
3343
+ return customViews.value.find((entry) => entry.id === viewId) ?? null;
3344
+ });
3345
+ /** Narrow a (possibly custom) mode to a built-in one, used where only the
3346
+ * built-in views are representable (the embedded card's viewState). */
3347
+ function builtInViewOrTable(mode) {
3348
+ return mode === "calendar" || mode === "kanban" ? mode : "table";
3349
+ }
3350
+ /** Whether to offer the "+" (author a new custom view) button. Standalone
3351
+ * page only (the seed starts a chat). Feeds qualify too — their views are
3352
+ * authored under feeds/<slug>/ and the seed prompt points there. */
3353
+ const canAddCustomView = (0, vue.computed)(() => Boolean(collection.value) && !embedded.value);
3354
+ /** Seed a chat asking Claude to author a new custom view for this collection.
3355
+ * Reuses the same chat-seed path as collection actions — the host injects a
3356
+ * templated prompt; Claude asks, authors the HTML, and registers it. The
3357
+ * authoring base is source-aware: a feed lives under `feeds/<slug>/`, every
3358
+ * other collection under the `data/skills/<slug>/` staging dir. */
3359
+ function addCustomView() {
3360
+ const current = collection.value;
3361
+ if (!current) return;
3362
+ const base = current.schema.ingest ? `feeds/${current.slug}` : `data/skills/${current.slug}`;
3363
+ const prompt = t("collectionsView.addViewPrompt", {
3364
+ title: current.title,
3365
+ base
3366
+ });
3367
+ if (props.sendTextMessage) {
3368
+ props.sendTextMessage(prompt);
3369
+ return;
3370
+ }
3371
+ appApi.startNewChat(prompt, cui.generalRoleId);
3372
+ }
3373
+ const configOpen = (0, vue.ref)(false);
3374
+ /** Whether to offer the config gear. Standalone page only, and only when
3375
+ * there's a deletable custom view to manage — i.e. the collection is one
3376
+ * whose views the server will delete (project non-preset, or a feed; never a
3377
+ * read-only user-scope skill). Mirrors the server's refusal rules. */
3378
+ const canConfigureViews = (0, vue.computed)(() => !embedded.value && hasCustomViews.value && (canDeleteCollection.value || isFeed.value));
3379
+ /** Reload the collection after the config modal deletes a view so the toggle
3380
+ * row + the modal's own list reflect the removal. */
3381
+ async function onViewsChanged() {
3382
+ const current = collection.value;
3383
+ if (current) await loadCollection(current.slug);
3384
+ }
3385
+ /** True when the calendar is the active body. */
3386
+ const calendarActive = (0, vue.computed)(() => activeView.value === "calendar");
3387
+ /** True when the kanban is the active body. */
3388
+ const kanbanActive = (0, vue.computed)(() => activeView.value === "kanban");
3389
+ const kanbanOverride = (0, vue.ref)(props.initialGroupField ?? null);
3390
+ const kanbanGroupField = (0, vue.computed)(() => {
3391
+ if (kanbanOverride.value && enumFields.value.includes(kanbanOverride.value)) return kanbanOverride.value;
3392
+ const hint = collection.value?.schema.kanbanField;
3393
+ if (hint && enumFields.value.includes(hint)) return hint;
3394
+ return enumFields.value[0] ?? "";
3395
+ });
3396
+ const anchorOverride = (0, vue.ref)(props.initialAnchorField ?? null);
3397
+ const calendarAnchorField = (0, vue.computed)(() => {
3398
+ if (anchorOverride.value && dateFields.value.includes(anchorOverride.value)) return anchorOverride.value;
3399
+ const hint = collection.value?.schema.calendarField;
3400
+ if (hint && dateFields.value.includes(hint)) return hint;
3401
+ return dateFields.value[0] ?? "";
3402
+ });
3403
+ const calendarEndField = (0, vue.computed)(() => {
3404
+ const schema = collection.value?.schema;
3405
+ if (!schema?.calendarEndField) return void 0;
3406
+ return calendarAnchorField.value === schema.calendarField ? schema.calendarEndField : void 0;
3407
+ });
3408
+ const calendarTimeField = (0, vue.computed)(() => {
3409
+ const schema = collection.value?.schema;
3410
+ if (!schema?.calendarTimeField) return void 0;
3411
+ return calendarAnchorField.value === schema.calendarField ? schema.calendarTimeField : void 0;
3412
+ });
3413
+ function setView(next) {
3414
+ view.value = next;
3415
+ }
3416
+ /** Select a custom view by id (builds the `custom:<id>` mode key). */
3417
+ function setCustomView(viewId) {
3418
+ view.value = `custom:${viewId}`;
3419
+ }
3420
+ /** Selector-key for a custom view, for active-state comparison in the template. */
3421
+ function customViewKey(viewId) {
3422
+ return `custom:${viewId}`;
3423
+ }
3424
+ /** A short, slug-safe id not already used by a loaded record. Collisions
3425
+ * are astronomically unlikely (32 bits), but we still re-roll a few
3426
+ * times against the in-memory set before giving up and using the last
3427
+ * candidate (the server's overwrite guard is the final backstop). */
3428
+ function generateUniqueItemId(primaryKey) {
3429
+ const existing = new Set(items.value.map((item) => String(item[primaryKey] ?? "")));
3430
+ let candidate = require_promptSafety.shortHexId();
3431
+ for (let attempt = 0; attempt < 8 && existing.has(candidate); attempt++) candidate = require_promptSafety.shortHexId();
3432
+ return candidate;
3433
+ }
3434
+ function openCreate() {
3435
+ if (!collection.value) return;
3436
+ const text = {};
3437
+ const bool = {};
3438
+ const boolOriginallyPresent = {};
3439
+ const boolTouched = {};
3440
+ const table = {};
3441
+ for (const [key, field] of Object.entries(collection.value.schema.fields)) if (field.type === "boolean") {
3442
+ bool[key] = false;
3443
+ boolOriginallyPresent[key] = false;
3444
+ boolTouched[key] = false;
3445
+ } else if (field.type === "table") table[key] = [];
3446
+ else if (field.type !== "derived" && field.type !== "embed" && field.type !== "toggle") text[key] = "";
3447
+ const { singleton, primaryKey } = collection.value.schema;
3448
+ if (singleton) text[primaryKey] = singleton;
3449
+ else if (primaryKey in text) text[primaryKey] = generateUniqueItemId(primaryKey);
3450
+ viewing.value = null;
3451
+ editing.value = {
3452
+ mode: "create",
3453
+ text,
3454
+ bool,
3455
+ boolOriginallyPresent,
3456
+ boolTouched,
3457
+ table,
3458
+ originalId: null
3459
+ };
3460
+ saveError.value = null;
3461
+ }
3462
+ function openEdit(item) {
3463
+ if (!collection.value) return;
3464
+ const text = {};
3465
+ const bool = {};
3466
+ const boolOriginallyPresent = {};
3467
+ const boolTouched = {};
3468
+ const table = {};
3469
+ for (const [key, field] of Object.entries(collection.value.schema.fields)) {
3470
+ const raw = item[key];
3471
+ if (field.type === "boolean") {
3472
+ bool[key] = raw === true;
3473
+ boolOriginallyPresent[key] = typeof raw === "boolean";
3474
+ boolTouched[key] = false;
3475
+ } else if (field.type === "table" && field.of) {
3476
+ const sub = field.of;
3477
+ table[key] = (Array.isArray(raw) ? raw : []).filter((row) => Boolean(row) && typeof row === "object" && !Array.isArray(row)).map((row) => require_promptSafety.rowFromItem(row, sub));
3478
+ } else if (field.type !== "derived" && field.type !== "embed" && field.type !== "toggle") text[key] = raw === void 0 || raw === null ? "" : String(raw);
3479
+ }
3480
+ const primaryRaw = item[collection.value.schema.primaryKey];
3481
+ const originalId = typeof primaryRaw === "string" ? primaryRaw : String(primaryRaw ?? "");
3482
+ viewing.value = null;
3483
+ editing.value = {
3484
+ mode: "edit",
3485
+ text,
3486
+ bool,
3487
+ boolOriginallyPresent,
3488
+ boolTouched,
3489
+ table,
3490
+ originalId
3491
+ };
3492
+ saveError.value = null;
3493
+ }
3494
+ function closeEditor() {
3495
+ editing.value = null;
3496
+ saving.value = false;
3497
+ saveError.value = null;
3498
+ }
3499
+ /** Cancel the editor. Edit → reopen the record's read-only detail (don't
3500
+ * collapse the panel); create → just close (no prior detail to show). */
3501
+ function cancelEditor() {
3502
+ const draft = editing.value;
3503
+ const returnTo = draft && draft.mode === "edit" ? draft.originalId : null;
3504
+ closeEditor();
3505
+ if (returnTo) {
3506
+ const item = findItemById(returnTo);
3507
+ if (item) showDetail(item);
3508
+ }
3509
+ }
3510
+ /** Open mode (read-only detail). Toggles: clicking the already-open row
3511
+ * collapses it. Opening a row cancels any in-progress edit (one panel
3512
+ * open at a time). In embedded mode, report the open id so the host
3513
+ * card can persist it in `viewState`. */
3514
+ function openView(item) {
3515
+ if (isRowOpen(item) && !editing.value) {
3516
+ closeView();
3517
+ return;
3518
+ }
3519
+ if (editing.value) closeEditor();
3520
+ showDetail(item);
3521
+ }
3522
+ /** Open the read-only detail for a record WITHOUT the click-toggle. Used
3523
+ * when reopening detail programmatically (after save / cancel), where
3524
+ * `openView`'s "click the open row to collapse" guard would otherwise
3525
+ * immediately close a row the embedded `viewState` sync just reopened. */
3526
+ function showDetail(item) {
3527
+ viewing.value = item;
3528
+ actionError.value = null;
3529
+ if (embedded.value && collection.value) emit("select", String(item[collection.value.schema.primaryKey] ?? ""));
3530
+ }
3531
+ /** Close open mode. Embedded mode reports the close via `select(null)`
3532
+ * (the card clears its `viewState`); standalone mode drops the
3533
+ * `?selected=` query param so a refresh / back-button doesn't reopen
3534
+ * the record and the URL reflects the closed state. */
3535
+ function closeView() {
3536
+ viewing.value = null;
3537
+ actionError.value = null;
3538
+ if (embedded.value) {
3539
+ emit("select", null);
3540
+ return;
3541
+ }
3542
+ if (cui.routeSelectedId() !== void 0) cui.setSelectedId(null);
3543
+ }
3544
+ /** Backdrop click / Escape on the shared record modal. While editing this
3545
+ * cancels the draft (reopening the detail, matching the in-panel Cancel
3546
+ * button — so a stray click never silently discards edits); while viewing
3547
+ * it closes the detail. */
3548
+ function closeRecordModal() {
3549
+ if (editing.value) {
3550
+ cancelEditor();
3551
+ return;
3552
+ }
3553
+ closeView();
3554
+ }
3555
+ /** Hand off from open mode to the editor for the same record. */
3556
+ function editFromView() {
3557
+ const item = viewing.value;
3558
+ if (!item) return;
3559
+ viewing.value = null;
3560
+ openEdit(item);
3561
+ }
3562
+ function findItemById(itemId) {
3563
+ if (!collection.value) return void 0;
3564
+ const { primaryKey } = collection.value.schema;
3565
+ return items.value.find((item) => String(item[primaryKey] ?? "") === itemId);
3566
+ }
3567
+ /** Reconcile the open-mode view with the `?selected=<id>` query —
3568
+ * the single source of truth for which record is open. Opens the
3569
+ * matching record, or closes the modal when the param is absent /
3570
+ * empty / points at an id that isn't loaded (deleted record, stale
3571
+ * link). Keeping `viewing` in lockstep with the URL means browser
3572
+ * back / forward and a removed param both close the modal instead
3573
+ * of leaving stale UI on screen (Codex P2 + CodeRabbit on #1502). */
3574
+ function syncViewToSelected() {
3575
+ const selected = activeSelected.value;
3576
+ if (typeof selected !== "string" || selected.length === 0) {
3577
+ viewing.value = null;
3578
+ return;
3579
+ }
3580
+ viewing.value = findItemById(selected) ?? null;
3581
+ }
3582
+ /** Title for the open-mode header: the record's primary-key value
3583
+ * (e.g. `INV-2026-0001`), falling back to the collection title.
3584
+ * Non-string primary keys (numeric ids) are stringified rather
3585
+ * than discarded (CodeRabbit on #1502). */
3586
+ const viewTitle = (0, vue.computed)(() => {
3587
+ if (!viewing.value || !collection.value) return "";
3588
+ const pkValue = viewing.value[collection.value.schema.primaryKey];
3589
+ if (pkValue === void 0 || pkValue === null || pkValue === "") return collection.value.title ?? "";
3590
+ return String(pkValue);
3591
+ });
3592
+ /** Live computed record from the current draft. Drives derived
3593
+ * field displays in the form so subtotal/tax/total update as
3594
+ * the user edits line items. */
3595
+ const liveRecord = (0, vue.computed)(() => {
3596
+ if (!collection.value || !editing.value) return null;
3597
+ return require_promptSafety.draftToRecord(editing.value, collection.value.schema);
3598
+ });
3599
+ /** Live record with derived fields resolved (drives the form's
3600
+ * read-only derived inputs). Derivation lives in the shared
3601
+ * rendering composable; this binds it to the current draft. */
3602
+ const liveDerived = (0, vue.computed)(() => {
3603
+ if (!collection.value || !liveRecord.value) return null;
3604
+ return render.deriveAll(collection.value.schema, liveRecord.value, refRecordCache.value);
3605
+ });
3606
+ /** Short summary for a `table`-typed cell in the main collection
3607
+ * table. Counts rows; nothing fancier yet (per-row preview is
3608
+ * hard to fit in a single cell). */
3609
+ function tableSummary(value) {
3610
+ if (!Array.isArray(value)) return "—";
3611
+ if (value.length === 0) return "—";
3612
+ return t("collectionsView.tableSummary", { count: value.length });
3613
+ }
3614
+ async function saveEditor() {
3615
+ if (!collection.value || !editing.value) return;
3616
+ const { slug, schema } = collection.value;
3617
+ const draft = editing.value;
3618
+ saveError.value = null;
3619
+ const missing = require_promptSafety.firstMissingRequiredField(draft, schema);
3620
+ if (missing) {
3621
+ saveError.value = `${missing}: ${t("collectionsView.requiredField")}`;
3622
+ return;
3623
+ }
3624
+ saving.value = true;
3625
+ const record = require_promptSafety.draftToRecord(draft, schema);
3626
+ const result = draft.mode === "create" ? await cui.createItem(slug, record) : await cui.updateItem(slug, draft.originalId ?? "", record);
3627
+ saving.value = false;
3628
+ if (!result.ok) {
3629
+ saveError.value = result.error;
3630
+ return;
3631
+ }
3632
+ const savedId = result.data.itemId;
3633
+ closeEditor();
3634
+ await loadCollection(slug);
3635
+ const saved = findItemById(savedId);
3636
+ if (saved) showDetail(saved);
3637
+ }
3638
+ /** Write a single cell's value directly onto the live `items` entry.
3639
+ * Reactive in Vue 3 (proxy), so the bound checkbox/select re-renders.
3640
+ * `undefined` (enum cleared to the placeholder) renders as the empty
3641
+ * option; the PUT body omits the key via `buildUpdatedRecord`. */
3642
+ function applyInlineValue(item, key, value) {
3643
+ item[key] = value;
3644
+ }
3645
+ /** True while this row has an inline cell save in flight — its inline
3646
+ * controls render disabled to serialize edits (one PUT per row). */
3647
+ function isRowInlineSaving(item) {
3648
+ return inlineSavingRows.value.has(rowId(item));
3649
+ }
3650
+ /** Inline table-cell edit (boolean checkbox / enum dropdown): optimistic
3651
+ * update, then PUT the full record. Gated per row so a second edit can't
3652
+ * race the in-flight one. On failure, roll the cell back and surface the
3653
+ * error. Bypasses the detail/edit panel entirely. */
3654
+ async function commitInlineEdit(item, key, field, raw) {
3655
+ if (!collection.value) return;
3656
+ const { slug } = collection.value;
3657
+ const itemId = rowId(item);
3658
+ if (!itemId || inlineSavingRows.value.has(itemId)) return;
3659
+ const previous = item[key];
3660
+ const coerced = require_promptSafety.coerceInlineValue(field, raw);
3661
+ applyInlineValue(item, key, coerced);
3662
+ inlineError.value = null;
3663
+ inlineSavingRows.value.add(itemId);
3664
+ const result = await cui.updateItem(slug, itemId, require_promptSafety.buildUpdatedRecord(item, key, coerced));
3665
+ inlineSavingRows.value.delete(itemId);
3666
+ if (!result.ok) {
3667
+ applyInlineValue(item, key, previous);
3668
+ inlineError.value = result.error;
3669
+ }
3670
+ }
3671
+ /** Whether a `toggle` field reads as checked: its projected enum field
3672
+ * currently equals `onValue`. The toggle stores nothing itself. */
3673
+ function toggleChecked(item, field) {
3674
+ return field.field !== void 0 && String(item[field.field] ?? "") === field.onValue;
3675
+ }
3676
+ /** Flip a `toggle`: write the projected enum field to `offValue` when
3677
+ * currently checked, else `onValue`. Reuses the inline-edit PUT path
3678
+ * (optimistic + rollback) — the toggle has no value of its own. */
3679
+ function commitToggle(item, field) {
3680
+ const targetKey = field.field;
3681
+ if (!targetKey || !collection.value) return;
3682
+ const enumField = collection.value.schema.fields[targetKey];
3683
+ if (!enumField) return;
3684
+ const next = toggleChecked(item, field) ? field.offValue : field.onValue;
3685
+ if (next === void 0) return;
3686
+ commitInlineEdit(item, targetKey, enumField, next);
3687
+ }
3688
+ async function confirmDelete(item) {
3689
+ if (!collection.value) return;
3690
+ const { slug } = collection.value;
3691
+ const { primaryKey } = collection.value.schema;
3692
+ const idRaw = item[primaryKey];
3693
+ const itemId = typeof idRaw === "string" ? idRaw : String(idRaw ?? "");
3694
+ if (!itemId) return;
3695
+ if (!await openConfirm({
3696
+ message: t("collectionsView.confirmDelete"),
3697
+ confirmText: t("common.remove"),
3698
+ cancelText: t("common.cancel"),
3699
+ variant: "danger"
3700
+ })) return;
3701
+ const result = await cui.deleteItem(slug, itemId);
3702
+ if (!result.ok) {
3703
+ loadError.value = result.error;
3704
+ return;
3705
+ }
3706
+ await loadCollection(slug);
3707
+ }
3708
+ async function confirmCollectionDelete() {
3709
+ const current = collection.value;
3710
+ if (!current) return;
3711
+ const { slug, title } = current;
3712
+ if (!await openConfirm({
3713
+ message: t("collectionsView.confirmDeleteCollection", { title }),
3714
+ confirmText: t("common.remove"),
3715
+ cancelText: t("common.cancel"),
3716
+ variant: "danger"
3717
+ })) return;
3718
+ const result = await cui.deleteCollection(slug);
3719
+ if (!result.ok) {
3720
+ loadError.value = result.error;
3721
+ return;
3722
+ }
3723
+ cui.gotoIndex("collection");
3724
+ }
3725
+ function goBack() {
3726
+ cui.gotoIndex(isFeedRoute.value ? "feed" : "collection");
3727
+ }
3728
+ async function confirmFeedDelete() {
3729
+ const current = collection.value;
3730
+ if (!current) return;
3731
+ const { slug, title } = current;
3732
+ if (!await openConfirm({
3733
+ message: t("collectionsView.confirmDeleteFeed", { title }),
3734
+ confirmText: t("common.remove"),
3735
+ cancelText: t("common.cancel"),
3736
+ variant: "danger"
3737
+ })) return;
3738
+ const result = await cui.deleteFeed(slug);
3739
+ if (!result.ok) {
3740
+ loadError.value = result.error;
3741
+ return;
3742
+ }
3743
+ cui.gotoIndex("feed");
3744
+ }
3745
+ /** Open the create form with the clicked calendar day prefilled into the
3746
+ * anchor field. The calendar day view's + affordance; the create flow itself
3747
+ * is the same one the Add button uses. A `datetime` anchor renders as a
3748
+ * `datetime-local` input, which rejects a bare `YYYY-MM-DD` — seed midnight
3749
+ * so the chosen day actually survives the prefill. */
3750
+ function createOnDate(iso) {
3751
+ if (!canCreate.value) return;
3752
+ openCreate();
3753
+ const anchor = calendarAnchorField.value;
3754
+ if (!editing.value || !anchor) return;
3755
+ const anchorType = collection.value?.schema.fields[anchor]?.type;
3756
+ editing.value.text[anchor] = anchorType === "datetime" ? `${iso}T00:00` : iso;
3757
+ }
3758
+ /** The civil day a record sits on, from its calendar anchor field (handles
3759
+ * both `date` and `datetime`). Null for undated records. */
3760
+ function dayOfItem(item) {
3761
+ return require_promptSafety.dateOf(item[calendarAnchorField.value]);
3762
+ }
3763
+ /** Mirror the open record into the `?selected=<id>` query (standalone mode)
3764
+ * so the calendar's day-view + selection is a copy-pasteable link. In-app
3765
+ * selection didn't previously touch the URL; the calendar now does. */
3766
+ function writeSelectedToUrl(itemId) {
3767
+ if (embedded.value || cui.routeSelectedId() === itemId) return;
3768
+ cui.setSelectedId(itemId);
3769
+ }
3770
+ /** Calendar chip / kanban card click → open that record's detail. In the
3771
+ * calendar it opens the day (time-allocation) popup on the record's day with
3772
+ * the detail in the right pane; an undated record falls back to the panel
3773
+ * below the grid. Unlike `openView`, this never toggles — a second click on
3774
+ * the same record keeps it open. */
3775
+ function onCalendarSelect(itemId) {
3776
+ if (!itemId) {
3777
+ closeView();
3778
+ return;
3779
+ }
3780
+ const item = findItemById(itemId);
3781
+ if (!item) return;
3782
+ if (editing.value) closeEditor();
3783
+ if (calendarActive.value) openDay.value = dayOfItem(item);
3784
+ showDetail(item);
3785
+ writeSelectedToUrl(itemId);
3786
+ }
3787
+ /** A calendar day cell was activated → open its popup on a clean slate
3788
+ * (clear any prior selection so the popup opens timeline-only). */
3789
+ function onOpenDay(day) {
3790
+ if (editing.value) closeEditor();
3791
+ closeView();
3792
+ openDay.value = day;
3793
+ }
3794
+ /** Close the day popup: drop the open day, the selection, AND any in-progress
3795
+ * draft together. Clearing `editing` matters because the shared record modal
3796
+ * shows whenever `editing` is set and no day is open — so without this, an
3797
+ * edit/create started inside the day popup would re-appear in the centred
3798
+ * modal the instant the popup closed (Codex P2 on #1656). */
3799
+ function onDayClose() {
3800
+ openDay.value = null;
3801
+ if (editing.value) closeEditor();
3802
+ closeView();
3803
+ }
3804
+ /** Deep-link entry: a `?selected=<id>` link to a calendar-capable collection
3805
+ * opens in calendar view with the popup focused on the record's day. Runs
3806
+ * on load / slug change only (not on in-app selection), so table users
3807
+ * aren't forced into the calendar. */
3808
+ function maybeOpenCalendarForSelected() {
3809
+ if (embedded.value || !hasCalendar.value || !viewing.value) return;
3810
+ const day = dayOfItem(viewing.value);
3811
+ if (!day) return;
3812
+ view.value = "calendar";
3813
+ openDay.value = day;
3814
+ }
3815
+ /** Kanban card dropped in a column → set the record's group field to the
3816
+ * column value (the empty string clears it for the Uncategorized column).
3817
+ * Reuses the inline-edit path (optimistic write + PUT + rollback). */
3818
+ function onKanbanMove(itemId, value) {
3819
+ const item = findItemById(itemId);
3820
+ const key = kanbanGroupField.value;
3821
+ const field = collection.value?.schema.fields[key];
3822
+ if (!item || !field) return;
3823
+ commitInlineEdit(item, key, field, value);
3824
+ }
3825
+ (0, vue.watch)(activeSlug, (slug, prevSlug) => {
3826
+ if (prevSlug !== void 0 && slug !== prevSlug) {
3827
+ view.value = slug && readCollectionViewMode(slug) || "table";
3828
+ anchorOverride.value = null;
3829
+ kanbanOverride.value = null;
3830
+ sortState.value = storedSortFor(slug);
3831
+ }
3832
+ if (slug) loadCollection(slug);
3833
+ else {
3834
+ collection.value = null;
3835
+ items.value = [];
3836
+ enumOriginallyEmpty.value = /* @__PURE__ */ new Set();
3837
+ inlineSavingRows.value = /* @__PURE__ */ new Set();
3838
+ searchQuery.value = "";
3839
+ loading.value = false;
3840
+ }
3841
+ }, { immediate: true });
3842
+ (0, vue.watch)([
3843
+ activeView,
3844
+ calendarAnchorField,
3845
+ kanbanGroupField,
3846
+ sortState,
3847
+ loading
3848
+ ], () => {
3849
+ if (embedded.value) emit("viewStateChange", {
3850
+ view: builtInViewOrTable(activeView.value),
3851
+ anchorField: calendarAnchorField.value,
3852
+ groupField: kanbanGroupField.value
3853
+ });
3854
+ if (activeSlug.value && !loading.value && collection.value) {
3855
+ if (!embedded.value) writeCollectionViewMode(activeSlug.value, activeView.value);
3856
+ writeCollectionSort(activeSlug.value, sortState.value);
3857
+ }
3858
+ });
3859
+ (0, vue.watch)(activeSelected, () => {
3860
+ if (loading.value || !collection.value) return;
3861
+ syncViewToSelected();
3862
+ openDay.value = viewing.value ? dayOfItem(viewing.value) : null;
3863
+ });
3864
+ return (_ctx, _cache) => {
3865
+ const _component_router_link = (0, vue.resolveComponent)("router-link");
3866
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$2, [
3867
+ (0, vue.createElementVNode)("header", _hoisted_2$2, [
3868
+ !embedded.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3869
+ key: 0,
3870
+ type: "button",
3871
+ class: "h-8 w-8 flex items-center justify-center rounded text-slate-500 hover:bg-slate-50 hover:text-slate-800 transition-colors",
3872
+ title: (0, vue.unref)(t)("collectionsView.backToIndex"),
3873
+ "aria-label": (0, vue.unref)(t)("collectionsView.backToIndex"),
3874
+ "data-testid": "collections-back",
3875
+ onClick: goBack
3876
+ }, [..._cache[25] || (_cache[25] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "arrow_back", -1)])], 8, _hoisted_3$2)) : (0, vue.createCommentVNode)("", true),
3877
+ collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_4$2, [(0, vue.createElementVNode)("span", _hoisted_5$2, (0, vue.toDisplayString)(collection.value.icon), 1)])) : (0, vue.createCommentVNode)("", true),
3878
+ (0, vue.createElementVNode)("div", _hoisted_6$2, [(0, vue.createElementVNode)("h1", _hoisted_7$2, (0, vue.toDisplayString)(collection.value?.title ?? (0, vue.unref)(t)("collectionsView.title")), 1), collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_8$2, (0, vue.toDisplayString)(collection.value.slug), 1)) : (0, vue.createCommentVNode)("", true)]),
3879
+ collection.value && !embedded.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(pinToggle)), {
3880
+ key: 2,
3881
+ kind: isFeedRoute.value ? "feed" : "collection",
3882
+ slug: collection.value.slug,
3883
+ title: collection.value.title,
3884
+ icon: collection.value.icon
3885
+ }, null, 8, [
3886
+ "kind",
3887
+ "slug",
3888
+ "title",
3889
+ "icon"
3890
+ ])) : (0, vue.createCommentVNode)("", true),
3891
+ collection.value?.schema.ingest ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3892
+ key: 3,
3893
+ type: "button",
3894
+ class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors disabled:opacity-50",
3895
+ disabled: refreshing.value,
3896
+ "data-testid": "collections-refresh-feed",
3897
+ onClick: refreshFeed
3898
+ }, [(0, vue.createElementVNode)("span", _hoisted_10$2, (0, vue.toDisplayString)(refreshing.value ? "hourglass_empty" : "refresh"), 1), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.refreshFeed")), 1)], 8, _hoisted_9$2)) : (0, vue.createCommentVNode)("", true),
3899
+ collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3900
+ key: 4,
3901
+ type: "button",
3902
+ class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors",
3903
+ "data-testid": "collections-chat",
3904
+ onClick: openChat
3905
+ }, [_cache[26] || (_cache[26] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "forum", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chat")), 1)])) : (0, vue.createCommentVNode)("", true),
3906
+ ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(collectionActions.value, (action) => {
3907
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3908
+ key: action.id,
3909
+ type: "button",
3910
+ class: "h-8 px-2.5 flex items-center gap-1 rounded border border-indigo-200 bg-white hover:bg-indigo-50 text-indigo-600 font-bold text-xs transition-colors disabled:opacity-50",
3911
+ disabled: collectionActionPending.value,
3912
+ "data-testid": `collections-action-${action.id}`,
3913
+ onClick: ($event) => runCollectionAction(action)
3914
+ }, [action.icon ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_12$2, (0, vue.toDisplayString)(action.icon), 1)) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(action.label), 1)], 8, _hoisted_11$2);
3915
+ }), 128)),
3916
+ canCreate.value && !calendarActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3917
+ key: 5,
3918
+ type: "button",
3919
+ class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
3920
+ "data-testid": "collections-add-item",
3921
+ onClick: openCreate
3922
+ }, [_cache[27] || (_cache[27] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "add", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.add")), 1)])) : (0, vue.createCommentVNode)("", true),
3923
+ canDeleteCollection.value && !embedded.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3924
+ key: 6,
3925
+ type: "button",
3926
+ class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 transition-colors",
3927
+ title: (0, vue.unref)(t)("collectionsView.deleteCollection"),
3928
+ "aria-label": (0, vue.unref)(t)("collectionsView.deleteCollection"),
3929
+ "data-testid": "collections-delete",
3930
+ onClick: confirmCollectionDelete
3931
+ }, [..._cache[28] || (_cache[28] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_13$2)) : (0, vue.createCommentVNode)("", true),
3932
+ canDeleteFeed.value && !embedded.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3933
+ key: 7,
3934
+ type: "button",
3935
+ class: "h-8 w-8 flex items-center justify-center rounded border border-rose-200 bg-white text-rose-600 hover:bg-rose-50 transition-colors",
3936
+ title: (0, vue.unref)(t)("collectionsView.deleteFeed"),
3937
+ "aria-label": (0, vue.unref)(t)("collectionsView.deleteFeed"),
3938
+ "data-testid": "feeds-delete",
3939
+ onClick: confirmFeedDelete
3940
+ }, [..._cache[29] || (_cache[29] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "delete_forever", -1)])], 8, _hoisted_14$2)) : (0, vue.createCommentVNode)("", true)
3941
+ ]),
3942
+ collection.value && (items.value.length > 0 || hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_15$2, [items.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_16$1, [
3943
+ _cache[31] || (_cache[31] = (0, vue.createElementVNode)("span", { class: "absolute inset-y-0 left-0 flex items-center pl-3 text-slate-400 pointer-events-none" }, [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "search")], -1)),
3944
+ (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
3945
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchQuery.value = $event),
3946
+ type: "text",
3947
+ placeholder: (0, vue.unref)(t)("collectionsView.searchPlaceholder"),
3948
+ "aria-label": (0, vue.unref)(t)("collectionsView.searchPlaceholder"),
3949
+ class: "w-full bg-slate-50 border border-slate-200/80 rounded-xl pl-9 pr-8 py-1.5 text-xs placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 focus:bg-white transition-all font-medium"
3950
+ }, null, 8, _hoisted_17$1), [[vue.vModelText, searchQuery.value]]),
3951
+ searchQuery.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3952
+ key: 0,
3953
+ type: "button",
3954
+ "aria-label": (0, vue.unref)(t)("collectionsView.clearSearch"),
3955
+ class: "absolute inset-y-0 right-0 flex items-center pr-2.5 text-slate-400 hover:text-slate-600",
3956
+ onClick: _cache[1] || (_cache[1] = ($event) => searchQuery.value = "")
3957
+ }, [..._cache[30] || (_cache[30] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "close", -1)])], 8, _hoisted_18$1)) : (0, vue.createCommentVNode)("", true)
3958
+ ])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_19$1, [
3959
+ hasCalendar.value || hasKanban.value || hasCustomViews.value || canAddCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
3960
+ key: 0,
3961
+ class: "flex gap-0.5",
3962
+ role: "group",
3963
+ "aria-label": (0, vue.unref)(t)("collectionsView.viewToggle")
3964
+ }, [
3965
+ (0, vue.createElementVNode)("button", {
3966
+ type: "button",
3967
+ class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "table" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
3968
+ "aria-pressed": activeView.value === "table",
3969
+ "data-testid": "collection-view-toggle-table",
3970
+ onClick: _cache[2] || (_cache[2] = ($event) => setView("table"))
3971
+ }, [_cache[32] || (_cache[32] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "table_rows", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewTable")), 1)], 10, _hoisted_21$1),
3972
+ hasCalendar.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3973
+ key: 0,
3974
+ type: "button",
3975
+ class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "calendar" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
3976
+ "aria-pressed": activeView.value === "calendar",
3977
+ "data-testid": "collection-view-toggle-calendar",
3978
+ onClick: _cache[3] || (_cache[3] = ($event) => setView("calendar"))
3979
+ }, [_cache[33] || (_cache[33] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "calendar_month", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewCalendar")), 1)], 10, _hoisted_22$1)) : (0, vue.createCommentVNode)("", true),
3980
+ hasKanban.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3981
+ key: 1,
3982
+ type: "button",
3983
+ class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === "kanban" ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
3984
+ "aria-pressed": activeView.value === "kanban",
3985
+ "data-testid": "collection-view-toggle-kanban",
3986
+ onClick: _cache[4] || (_cache[4] = ($event) => setView("kanban"))
3987
+ }, [_cache[34] || (_cache[34] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "view_kanban", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.viewKanban")), 1)], 10, _hoisted_23$1)) : (0, vue.createCommentVNode)("", true),
3988
+ ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(customViews.value, (cv) => {
3989
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3990
+ key: cv.id,
3991
+ type: "button",
3992
+ class: (0, vue.normalizeClass)(["h-8 px-2.5 flex items-center gap-1 rounded text-xs font-bold transition-colors", activeView.value === customViewKey(cv.id) ? "bg-indigo-600 text-white" : "bg-white text-slate-500 border border-slate-200 hover:bg-slate-50"]),
3993
+ "aria-pressed": activeView.value === customViewKey(cv.id),
3994
+ "data-testid": `collection-view-custom-${cv.id}`,
3995
+ onClick: ($event) => setCustomView(cv.id)
3996
+ }, [(0, vue.createElementVNode)("span", _hoisted_25, (0, vue.toDisplayString)(cv.icon || "dashboard_customize"), 1), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(cv.label), 1)], 10, _hoisted_24);
3997
+ }), 128)),
3998
+ canAddCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
3999
+ key: 2,
4000
+ type: "button",
4001
+ class: "h-8 w-8 flex items-center justify-center rounded bg-white text-slate-500 border border-slate-200 hover:bg-slate-50",
4002
+ title: (0, vue.unref)(t)("collectionsView.addView"),
4003
+ "aria-label": (0, vue.unref)(t)("collectionsView.addView"),
4004
+ "data-testid": "collection-view-add",
4005
+ onClick: addCustomView
4006
+ }, [..._cache[35] || (_cache[35] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "add", -1)])], 8, _hoisted_26)) : (0, vue.createCommentVNode)("", true),
4007
+ canConfigureViews.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
4008
+ key: 3,
4009
+ type: "button",
4010
+ class: "h-8 w-8 flex items-center justify-center rounded bg-white text-slate-500 border border-slate-200 hover:bg-slate-50",
4011
+ title: (0, vue.unref)(t)("collectionsView.config.open"),
4012
+ "aria-label": (0, vue.unref)(t)("collectionsView.config.open"),
4013
+ "data-testid": "collection-config-open",
4014
+ onClick: _cache[5] || (_cache[5] = ($event) => configOpen.value = true)
4015
+ }, [..._cache[36] || (_cache[36] = [(0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "settings", -1)])], 8, _hoisted_27)) : (0, vue.createCommentVNode)("", true)
4016
+ ], 8, _hoisted_20$1)) : (0, vue.createCommentVNode)("", true),
4017
+ calendarActive.value && dateFields.value.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
4018
+ key: 1,
4019
+ value: calendarAnchorField.value,
4020
+ class: "h-8 px-2 rounded border border-slate-200 bg-white text-xs font-semibold text-slate-600 focus:outline-none focus:border-indigo-500 cursor-pointer",
4021
+ "aria-label": (0, vue.unref)(t)("collectionsView.calendarFieldLabel"),
4022
+ "data-testid": "collection-calendar-field",
4023
+ onChange: _cache[6] || (_cache[6] = ($event) => anchorOverride.value = $event.target.value)
4024
+ }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(dateFields.value, (key) => {
4025
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
4026
+ key,
4027
+ value: key
4028
+ }, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_29);
4029
+ }), 128))], 40, _hoisted_28)) : (0, vue.createCommentVNode)("", true),
4030
+ kanbanActive.value && enumFields.value.length > 1 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
4031
+ key: 2,
4032
+ value: kanbanGroupField.value,
4033
+ class: "h-8 px-2 rounded border border-slate-200 bg-white text-xs font-semibold text-slate-600 focus:outline-none focus:border-indigo-500 cursor-pointer",
4034
+ "aria-label": (0, vue.unref)(t)("collectionsView.kanbanFieldLabel"),
4035
+ "data-testid": "collection-kanban-field",
4036
+ onChange: _cache[7] || (_cache[7] = ($event) => kanbanOverride.value = $event.target.value)
4037
+ }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(enumFields.value, (key) => {
4038
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
4039
+ key,
4040
+ value: key
4041
+ }, (0, vue.toDisplayString)(collection.value?.schema.fields[key]?.label ?? key), 9, _hoisted_31);
4042
+ }), 128))], 40, _hoisted_30)) : (0, vue.createCommentVNode)("", true),
4043
+ items.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_32, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.searchSummary", {
4044
+ shown: filteredItems.value.length,
4045
+ total: items.value.length
4046
+ })), 1)) : (0, vue.createCommentVNode)("", true)
4047
+ ])])) : (0, vue.createCommentVNode)("", true),
4048
+ collection.value && dataIssues.value.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_33, [
4049
+ _cache[38] || (_cache[38] = (0, vue.createElementVNode)("span", { class: "material-icons text-amber-600" }, "warning", -1)),
4050
+ (0, vue.createElementVNode)("span", _hoisted_34, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.dataIssuesDetected", { count: dataIssues.value.length })), 1),
4051
+ (0, vue.createElementVNode)("button", {
4052
+ type: "button",
4053
+ class: "h-8 px-2.5 flex items-center gap-1 rounded border border-amber-300 bg-white hover:bg-amber-100 text-amber-700 font-bold text-xs transition-colors",
4054
+ "data-testid": "collections-repair",
4055
+ onClick: repairCollection
4056
+ }, [_cache[37] || (_cache[37] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "build", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.repair")), 1)])
4057
+ ])) : (0, vue.createCommentVNode)("", true),
4058
+ (0, vue.createElementVNode)("div", _hoisted_35, [loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_36, [_cache[39] || (_cache[39] = (0, vue.createElementVNode)("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.loading")), 1)])) : loadError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_37, [_cache[40] || (_cache[40] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(loadError.value === "not-found" ? (0, vue.unref)(t)("collectionsView.notFound") : `${(0, vue.unref)(t)("collectionsView.loadFailed")}: ${loadError.value}`), 1)])) : !collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_38)) : calendarActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_39, [(0, vue.createVNode)(CollectionCalendarView_default, {
4059
+ schema: collection.value.schema,
4060
+ items: filteredItems.value,
4061
+ "anchor-field": calendarAnchorField.value,
4062
+ "end-field": calendarEndField.value,
4063
+ "time-field": calendarTimeField.value,
4064
+ "color-field": hasKanban.value ? kanbanGroupField.value : "",
4065
+ selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
4066
+ onSelect: onCalendarSelect,
4067
+ onOpenDay
4068
+ }, null, 8, [
4069
+ "schema",
4070
+ "items",
4071
+ "anchor-field",
4072
+ "end-field",
4073
+ "time-field",
4074
+ "color-field",
4075
+ "selected"
4076
+ ]), openDay.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionDayView_default, {
4077
+ key: 0,
4078
+ schema: collection.value.schema,
4079
+ items: filteredItems.value,
4080
+ day: openDay.value,
4081
+ "anchor-field": calendarAnchorField.value,
4082
+ "end-field": calendarEndField.value,
4083
+ "time-field": calendarTimeField.value,
4084
+ "color-field": hasKanban.value ? kanbanGroupField.value : "",
4085
+ selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
4086
+ "can-create": canCreate.value,
4087
+ "show-detail": Boolean(viewing.value || editing.value),
4088
+ onSelect: onCalendarSelect,
4089
+ onCreateOn: createOnDate,
4090
+ onClose: onDayClose
4091
+ }, {
4092
+ detail: (0, vue.withCtx)(() => [(0, vue.createVNode)(CollectionRecordPanel_default, {
4093
+ editing: editing.value,
4094
+ "onUpdate:editing": _cache[8] || (_cache[8] = ($event) => editing.value = $event),
4095
+ collection: collection.value,
4096
+ viewing: viewing.value,
4097
+ saving: saving.value,
4098
+ "save-error": saveError.value,
4099
+ "action-error": actionError.value,
4100
+ "action-pending": actionPending.value,
4101
+ "visible-actions": visibleActions.value,
4102
+ "live-record": liveRecord.value,
4103
+ "live-derived": liveDerived.value,
4104
+ "view-title": viewTitle.value,
4105
+ "is-singleton": isSingleton.value,
4106
+ render: (0, vue.unref)(render),
4107
+ locale: (0, vue.unref)(locale),
4108
+ onSubmit: saveEditor,
4109
+ onCancel: cancelEditor,
4110
+ onEdit: editFromView,
4111
+ onClose: onDayClose,
4112
+ onDelete: _cache[9] || (_cache[9] = ($event) => viewing.value && confirmDelete(viewing.value)),
4113
+ onRunAction: runAction
4114
+ }, null, 8, [
4115
+ "editing",
4116
+ "collection",
4117
+ "viewing",
4118
+ "saving",
4119
+ "save-error",
4120
+ "action-error",
4121
+ "action-pending",
4122
+ "visible-actions",
4123
+ "live-record",
4124
+ "live-derived",
4125
+ "view-title",
4126
+ "is-singleton",
4127
+ "render",
4128
+ "locale"
4129
+ ])]),
4130
+ _: 1
4131
+ }, 8, [
4132
+ "schema",
4133
+ "items",
4134
+ "day",
4135
+ "anchor-field",
4136
+ "end-field",
4137
+ "time-field",
4138
+ "color-field",
4139
+ "selected",
4140
+ "can-create",
4141
+ "show-detail"
4142
+ ])) : (0, vue.createCommentVNode)("", true)])) : kanbanActive.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_40, [inlineError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_41, [
4143
+ _cache[42] || (_cache[42] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)),
4144
+ (0, vue.createElementVNode)("span", _hoisted_42, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
4145
+ (0, vue.createElementVNode)("button", {
4146
+ type: "button",
4147
+ class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
4148
+ "aria-label": (0, vue.unref)(t)("common.close"),
4149
+ onClick: _cache[10] || (_cache[10] = ($event) => inlineError.value = null)
4150
+ }, [..._cache[41] || (_cache[41] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_43)
4151
+ ])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("div", _hoisted_44, [(0, vue.createVNode)(CollectionKanbanView_default, {
4152
+ schema: collection.value.schema,
4153
+ items: filteredItems.value,
4154
+ "group-field": kanbanGroupField.value,
4155
+ selected: viewing.value ? String(viewing.value[collection.value.schema.primaryKey] ?? "") : void 0,
4156
+ notified: notifiedSeverities.value,
4157
+ onSelect: onCalendarSelect,
4158
+ onMove: onKanbanMove
4159
+ }, null, 8, [
4160
+ "schema",
4161
+ "items",
4162
+ "group-field",
4163
+ "selected",
4164
+ "notified"
4165
+ ])])])) : activeCustomView.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_45, [(0, vue.createVNode)(CollectionCustomView_default, {
4166
+ slug: collection.value.slug,
4167
+ view: activeCustomView.value
4168
+ }, null, 8, ["slug", "view"])])) : items.value.length === 0 && editing.value?.mode !== "create" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_46, [_cache[43] || (_cache[43] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300" }, "folder_open", -1)), (0, vue.createElementVNode)("p", _hoisted_47, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.itemsEmpty")), 1)])) : filteredItems.value.length === 0 && editing.value?.mode !== "create" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_48, [
4169
+ _cache[44] || (_cache[44] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300" }, "search_off", -1)),
4170
+ (0, vue.createElementVNode)("p", _hoisted_49, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.noMatchingItems")), 1),
4171
+ (0, vue.createElementVNode)("button", {
4172
+ type: "button",
4173
+ class: "text-xs text-indigo-600 font-semibold hover:underline",
4174
+ onClick: _cache[11] || (_cache[11] = ($event) => searchQuery.value = "")
4175
+ }, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.clearSearch")), 1)
4176
+ ])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_50, [inlineError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_51, [
4177
+ _cache[46] || (_cache[46] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)),
4178
+ (0, vue.createElementVNode)("span", _hoisted_52, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.inlineSaveFailed", { error: inlineError.value })), 1),
4179
+ (0, vue.createElementVNode)("button", {
4180
+ type: "button",
4181
+ class: "h-8 w-8 flex items-center justify-center rounded text-red-600 hover:bg-red-100",
4182
+ "aria-label": (0, vue.unref)(t)("common.close"),
4183
+ onClick: _cache[12] || (_cache[12] = ($event) => inlineError.value = null)
4184
+ }, [..._cache[45] || (_cache[45] = [(0, vue.createElementVNode)("span", { class: "material-icons text-base" }, "close", -1)])], 8, _hoisted_53)
4185
+ ])) : (0, vue.createCommentVNode)("", true), (0, vue.createElementVNode)("table", _hoisted_54, [(0, vue.createElementVNode)("thead", null, [(0, vue.createElementVNode)("tr", _hoisted_55, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(listColumnFields.value, ([key, field]) => {
4186
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("th", {
4187
+ key,
4188
+ "aria-sort": (0, vue.unref)(require_promptSafety.isSortableField)(field) ? sortAriaValue(key) : void 0,
4189
+ class: "px-5 py-3 font-bold text-slate-500 text-left uppercase tracking-wider whitespace-nowrap"
4190
+ }, [(0, vue.createElementVNode)("div", _hoisted_57, [(0, vue.createElementVNode)("span", {
4191
+ class: "truncate max-w-[14rem]",
4192
+ title: field.label
4193
+ }, (0, vue.toDisplayString)(field.label), 9, _hoisted_58), (0, vue.unref)(require_promptSafety.isSortableField)(field) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("button", {
4194
+ key: 0,
4195
+ type: "button",
4196
+ class: (0, vue.normalizeClass)(["inline-flex items-center justify-center rounded p-0.5 -my-1 leading-none transition-colors", sortButtonClass(key)]),
4197
+ "data-testid": `collections-sort-${key}`,
4198
+ "aria-label": (0, vue.unref)(t)("collectionsView.sortBy", { field: field.label }),
4199
+ onClick: (0, vue.withModifiers)(($event) => cycleSort(key), ["stop"]),
4200
+ onPointerenter: ($event) => hoveredSortKey.value = key,
4201
+ onPointerleave: _cache[13] || (_cache[13] = ($event) => hoveredSortKey.value = null)
4202
+ }, [(0, vue.createElementVNode)("span", _hoisted_60, (0, vue.toDisplayString)(sortIconName(key)), 1)], 42, _hoisted_59)) : (0, vue.createCommentVNode)("", true)])], 8, _hoisted_56);
4203
+ }), 128))])]), (0, vue.createElementVNode)("tbody", _hoisted_61, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(sortedItems.value, (item) => {
4204
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("tr", {
4205
+ key: String(item[collection.value.schema.primaryKey] ?? ""),
4206
+ class: (0, vue.normalizeClass)(["hover:bg-slate-50/70 cursor-pointer transition-colors focus:outline-none focus:bg-indigo-50/30", isRowOpen(item) || isEditingRow(item) ? "bg-indigo-50/40" : ""]),
4207
+ role: "button",
4208
+ tabindex: "0",
4209
+ "aria-label": (0, vue.unref)(t)("collectionsView.openItem", { id: String(item[collection.value.schema.primaryKey] ?? "") }),
4210
+ "data-testid": `collections-row-${item[collection.value.schema.primaryKey]}`,
4211
+ onClick: ($event) => openView(item),
4212
+ onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(($event) => openView(item), ["self"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(($event) => openView(item), ["self", "prevent"]), ["space"])]
4213
+ }, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(listColumnFields.value, ([key, field]) => {
4214
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("td", {
4215
+ key,
4216
+ class: "px-5 py-2 text-slate-700 align-middle max-w-xs font-medium"
4217
+ }, [(0, vue.unref)(require_promptSafety.fieldVisible)(field, item) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [field.type === "toggle" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
4218
+ key: 0,
4219
+ type: "checkbox",
4220
+ checked: toggleChecked(item, field),
4221
+ disabled: isRowInlineSaving(item),
4222
+ class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer align-middle disabled:opacity-50 disabled:cursor-not-allowed",
4223
+ "data-testid": `collections-inline-toggle-${key}-${item[collection.value.schema.primaryKey]}`,
4224
+ "aria-label": field.label,
4225
+ onClick: _cache[14] || (_cache[14] = (0, vue.withModifiers)(() => {}, ["stop"])),
4226
+ onChange: ($event) => commitToggle(item, field)
4227
+ }, null, 40, _hoisted_63)) : field.type === "boolean" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("input", {
4228
+ key: 1,
4229
+ type: "checkbox",
4230
+ checked: item[key] === true,
4231
+ disabled: isRowInlineSaving(item),
4232
+ class: "h-5 w-5 rounded border-slate-300 text-indigo-600 focus:ring-indigo-500/20 cursor-pointer align-middle disabled:opacity-50 disabled:cursor-not-allowed",
4233
+ "data-testid": `collections-inline-bool-${key}-${item[collection.value.schema.primaryKey]}`,
4234
+ "aria-label": field.label,
4235
+ onClick: _cache[15] || (_cache[15] = (0, vue.withModifiers)(() => {}, ["stop"])),
4236
+ onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.checked)
4237
+ }, null, 40, _hoisted_64)) : field.type === "ref" && field.to && typeof item[key] === "string" && item[key] ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_65, [(0, vue.createVNode)(_component_router_link, {
4238
+ to: {
4239
+ path: `/collections/${field.to}`,
4240
+ query: { selected: String(item[key]) }
4241
+ },
4242
+ class: "text-indigo-600 hover:text-indigo-800 hover:underline font-semibold",
4243
+ "data-testid": `collections-ref-link-${key}-${item[key]}`,
4244
+ onClick: _cache[16] || (_cache[16] = (0, vue.withModifiers)(() => {}, ["stop"]))
4245
+ }, {
4246
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)((0, vue.unref)(refDisplay)(field.to, String(item[key]))), 1)]),
4247
+ _: 2
4248
+ }, 1032, ["to", "data-testid"])])) : field.type === "enum" && Array.isArray(field.values) && field.values.length > 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("select", {
4249
+ key: 3,
4250
+ value: item[key] == null ? "" : String(item[key]),
4251
+ disabled: isRowInlineSaving(item),
4252
+ class: (0, vue.normalizeClass)(["rounded-lg border px-2 py-0.5 text-[11px] font-semibold focus:border-indigo-500 focus:ring-2 focus:ring-indigo-500/20 focus:outline-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed", enumControlClass(String(key), item[key])]),
4253
+ "data-testid": `collections-inline-enum-${key}-${item[collection.value.schema.primaryKey]}`,
4254
+ "aria-label": field.label,
4255
+ onClick: _cache[17] || (_cache[17] = (0, vue.withModifiers)(() => {}, ["stop"])),
4256
+ onChange: ($event) => commitInlineEdit(item, String(key), field, $event.target.value)
4257
+ }, [showEnumPlaceholder(item, String(key)) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("option", _hoisted_67, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.selectPlaceholder")), 1)) : (0, vue.createCommentVNode)("", true), ((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(field.values, (value) => {
4258
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("option", {
4259
+ key: value,
4260
+ value
4261
+ }, (0, vue.toDisplayString)(value), 9, _hoisted_68);
4262
+ }), 128))], 42, _hoisted_66)) : field.type === "money" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_69, (0, vue.toDisplayString)((0, vue.unref)(formatMoney)(item[key], (0, vue.unref)(resolveCurrency)(field, item), (0, vue.unref)(locale))), 1)) : field.type === "table" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_70, [_cache[47] || (_cache[47] = (0, vue.createElementVNode)("span", { class: "material-icons text-[11px]" }, "list", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(tableSummary(item[key])), 1)])) : field.type === "derived" ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_71, (0, vue.toDisplayString)((0, vue.unref)(derivedDisplay)(field, (0, vue.unref)(evaluateDerivedAgainstItem)(field, String(key), item), item)), 1)) : field.type !== "file" && (0, vue.unref)(isExternalUrl)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
4263
+ key: 7,
4264
+ href: String(item[key]),
4265
+ target: "_blank",
4266
+ rel: "noopener noreferrer",
4267
+ class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
4268
+ "data-testid": `collections-url-link-${key}-${item[collection.value.schema.primaryKey]}`,
4269
+ onClick: _cache[18] || (_cache[18] = (0, vue.withModifiers)(() => {}, ["stop"]))
4270
+ }, (0, vue.toDisplayString)(String(item[key])), 9, _hoisted_72)) : field.type === "file" && (0, vue.unref)(artifactUrl)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("a", {
4271
+ key: 8,
4272
+ href: (0, vue.unref)(artifactUrl)(item[key]) ?? void 0,
4273
+ target: "_blank",
4274
+ rel: "noopener noreferrer",
4275
+ class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
4276
+ "data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
4277
+ onClick: _cache[19] || (_cache[19] = (0, vue.withModifiers)(() => {}, ["stop"]))
4278
+ }, (0, vue.toDisplayString)(String(item[key])), 9, _hoisted_73)) : field.type === "file" && (0, vue.unref)(fileRoutePath)(item[key]) ? ((0, vue.openBlock)(), (0, vue.createBlock)(_component_router_link, {
4279
+ key: 9,
4280
+ to: (0, vue.unref)(fileRoutePath)(item[key]) ?? "",
4281
+ class: "block truncate text-blue-600 hover:text-blue-800 hover:underline font-semibold",
4282
+ "data-testid": `collections-file-link-${key}-${item[collection.value.schema.primaryKey]}`,
4283
+ onClick: _cache[20] || (_cache[20] = (0, vue.withModifiers)(() => {}, ["stop"]))
4284
+ }, {
4285
+ default: (0, vue.withCtx)(() => [(0, vue.createTextVNode)((0, vue.toDisplayString)(String(item[key])), 1)]),
4286
+ _: 2
4287
+ }, 1032, ["to", "data-testid"])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", _hoisted_74, (0, vue.toDisplayString)((0, vue.unref)(formatCell)(item[key], field.type)), 1))], 64)) : (0, vue.createCommentVNode)("", true)]);
4288
+ }), 128))], 42, _hoisted_62);
4289
+ }), 128))])])]))]),
4290
+ collection.value && (viewing.value || editing.value) && !(calendarActive.value && openDay.value) ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionRecordModal_default, {
4291
+ key: 2,
4292
+ onClose: closeRecordModal
4293
+ }, {
4294
+ default: (0, vue.withCtx)(() => [(0, vue.createVNode)(CollectionRecordPanel_default, {
4295
+ editing: editing.value,
4296
+ "onUpdate:editing": _cache[21] || (_cache[21] = ($event) => editing.value = $event),
4297
+ collection: collection.value,
4298
+ viewing: viewing.value,
4299
+ saving: saving.value,
4300
+ "save-error": saveError.value,
4301
+ "action-error": actionError.value,
4302
+ "action-pending": actionPending.value,
4303
+ "visible-actions": visibleActions.value,
4304
+ "live-record": liveRecord.value,
4305
+ "live-derived": liveDerived.value,
4306
+ "view-title": viewTitle.value,
4307
+ "is-singleton": isSingleton.value,
4308
+ render: (0, vue.unref)(render),
4309
+ locale: (0, vue.unref)(locale),
4310
+ onSubmit: saveEditor,
4311
+ onCancel: cancelEditor,
4312
+ onEdit: editFromView,
4313
+ onClose: closeView,
4314
+ onDelete: _cache[22] || (_cache[22] = ($event) => viewing.value && confirmDelete(viewing.value)),
4315
+ onRunAction: runAction
4316
+ }, null, 8, [
4317
+ "editing",
4318
+ "collection",
4319
+ "viewing",
4320
+ "saving",
4321
+ "save-error",
4322
+ "action-error",
4323
+ "action-pending",
4324
+ "visible-actions",
4325
+ "live-record",
4326
+ "live-derived",
4327
+ "view-title",
4328
+ "is-singleton",
4329
+ "render",
4330
+ "locale"
4331
+ ])]),
4332
+ _: 1
4333
+ })) : (0, vue.createCommentVNode)("", true),
4334
+ configOpen.value && collection.value ? ((0, vue.openBlock)(), (0, vue.createBlock)(CollectionViewConfigModal_default, {
4335
+ key: 3,
4336
+ slug: collection.value.slug,
4337
+ title: collection.value.title,
4338
+ views: customViews.value,
4339
+ onChanged: onViewsChanged,
4340
+ onClose: _cache[23] || (_cache[23] = ($event) => configOpen.value = false)
4341
+ }, null, 8, [
4342
+ "slug",
4343
+ "title",
4344
+ "views"
4345
+ ])) : (0, vue.createCommentVNode)("", true),
4346
+ chatOpen.value && collection.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4347
+ key: 4,
4348
+ class: "fixed inset-0 z-30 flex items-center justify-center bg-slate-900/60 backdrop-blur-sm p-4 transition-all duration-300",
4349
+ role: "dialog",
4350
+ "aria-modal": "true",
4351
+ "aria-labelledby": "collections-chat-title",
4352
+ "data-testid": "collections-chat-modal",
4353
+ onClick: (0, vue.withModifiers)(closeChat, ["self"]),
4354
+ onKeydown: (0, vue.withKeys)(closeChat, ["esc"])
4355
+ }, [(0, vue.createElementVNode)("div", _hoisted_75, [
4356
+ (0, vue.createElementVNode)("header", _hoisted_76, [
4357
+ _cache[49] || (_cache[49] = (0, vue.createElementVNode)("div", { class: "h-9 w-9 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100/50" }, [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "forum")], -1)),
4358
+ (0, vue.createElementVNode)("div", _hoisted_77, [(0, vue.createElementVNode)("h2", _hoisted_78, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chatTitle")), 1), (0, vue.createElementVNode)("span", _hoisted_79, (0, vue.toDisplayString)(collection.value.title), 1)]),
4359
+ (0, vue.createElementVNode)("button", {
4360
+ type: "button",
4361
+ class: "h-8 w-8 flex items-center justify-center rounded text-slate-400 hover:bg-slate-200/50 hover:text-slate-600 transition-colors",
4362
+ "aria-label": (0, vue.unref)(t)("common.close"),
4363
+ "data-testid": "collections-chat-close",
4364
+ onClick: closeChat
4365
+ }, [..._cache[48] || (_cache[48] = [(0, vue.createElementVNode)("span", { class: "material-icons text-lg" }, "close", -1)])], 8, _hoisted_80)
4366
+ ]),
4367
+ (0, vue.createElementVNode)("div", _hoisted_81, [(0, vue.withDirectives)((0, vue.createElementVNode)("textarea", {
4368
+ ref_key: "chatInputEl",
4369
+ ref: chatInputEl,
4370
+ "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => chatMessage.value = $event),
4371
+ rows: "4",
4372
+ placeholder: (0, vue.unref)(t)("collectionsView.chatPlaceholder"),
4373
+ class: "w-full bg-slate-50 border border-slate-200/80 rounded-xl px-3 py-2.5 text-sm placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500 focus:bg-white transition-all resize-none",
4374
+ "data-testid": "collections-chat-input",
4375
+ onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(submitChat, ["meta"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(submitChat, ["ctrl"]), ["enter"])]
4376
+ }, null, 40, _hoisted_82), [[vue.vModelText, chatMessage.value]])]),
4377
+ (0, vue.createElementVNode)("footer", _hoisted_83, [(0, vue.createElementVNode)("button", {
4378
+ type: "button",
4379
+ class: "h-8 px-2.5 rounded text-xs font-bold text-slate-500 hover:bg-slate-200/50 transition-colors",
4380
+ "data-testid": "collections-chat-cancel",
4381
+ onClick: closeChat
4382
+ }, (0, vue.toDisplayString)((0, vue.unref)(t)("common.cancel")), 1), (0, vue.createElementVNode)("button", {
4383
+ type: "button",
4384
+ class: "h-8 px-2.5 rounded bg-indigo-600 text-white font-bold text-xs hover:bg-indigo-700 disabled:opacity-50 transition-all shadow-sm shadow-indigo-600/10",
4385
+ disabled: !chatMessage.value.trim(),
4386
+ "data-testid": "collections-chat-send",
4387
+ onClick: submitChat
4388
+ }, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.chatStart")), 9, _hoisted_84)])
4389
+ ])], 32)) : (0, vue.createCommentVNode)("", true)
4390
+ ]);
4391
+ };
4392
+ }
4393
+ });
4394
+ //#endregion
4395
+ //#region src/vue/components/CollectionsIndexView.vue?vue&type=script&setup=true&lang.ts
4396
+ var _hoisted_1$1 = {
4397
+ class: "h-full overflow-y-auto bg-slate-50/50 px-6 py-6",
4398
+ "data-testid": "collections-view-root"
4399
+ };
4400
+ var _hoisted_2$1 = { class: "max-w-4xl mx-auto" };
4401
+ var _hoisted_3$1 = { class: "flex items-center justify-between mb-6" };
4402
+ var _hoisted_4$1 = { class: "text-xl font-semibold text-slate-800" };
4403
+ var _hoisted_5$1 = {
4404
+ key: 0,
4405
+ class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
4406
+ };
4407
+ var _hoisted_6$1 = {
4408
+ key: 1,
4409
+ class: "rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
4410
+ };
4411
+ var _hoisted_7$1 = {
4412
+ key: 2,
4413
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500 shadow-sm"
4414
+ };
4415
+ var _hoisted_8$1 = { class: "font-medium text-slate-700" };
4416
+ var _hoisted_9$1 = {
4417
+ key: 3,
4418
+ class: "grid gap-4 sm:grid-cols-2"
4419
+ };
4420
+ var _hoisted_10$1 = [
4421
+ "aria-label",
4422
+ "data-testid",
4423
+ "onClick",
4424
+ "onKeydown"
4425
+ ];
4426
+ var _hoisted_11$1 = { class: "material-symbols-outlined text-2xl" };
4427
+ var _hoisted_12$1 = { class: "flex-1 min-w-0" };
4428
+ var _hoisted_13$1 = { class: "block font-semibold text-slate-800 text-[15px] group-hover:text-indigo-950 transition-colors truncate" };
4429
+ var _hoisted_14$1 = { class: "block text-[10px] text-slate-400 mt-1 tracking-wider font-semibold uppercase flex items-center gap-1.5" };
4430
+ var _hoisted_15$1 = { class: "text-[10px] bg-slate-100 px-1 rounded lowercase text-slate-500 font-mono font-normal" };
4431
+ //#endregion
4432
+ //#region src/vue/components/CollectionsIndexView.vue
4433
+ var CollectionsIndexView_default = /* @__PURE__ */ (0, vue.defineComponent)({
4434
+ __name: "CollectionsIndexView",
4435
+ setup(__props) {
4436
+ const { t } = useCollectionI18n();
4437
+ const cui = collectionUi();
4438
+ const { pinToggle, reconcileShortcuts } = cui;
4439
+ const collections = (0, vue.ref)([]);
4440
+ const loading = (0, vue.ref)(true);
4441
+ const loadError = (0, vue.ref)(null);
4442
+ async function loadCollections() {
4443
+ loading.value = true;
4444
+ loadError.value = null;
4445
+ const result = await cui.listCollections();
4446
+ loading.value = false;
4447
+ if (!result.ok) {
4448
+ loadError.value = result.error;
4449
+ return;
4450
+ }
4451
+ collections.value = result.data.collections.filter((collection) => collection.source !== "feed");
4452
+ reconcileShortcuts("collection", collections.value.map((collection) => ({
4453
+ slug: collection.slug,
4454
+ title: collection.title,
4455
+ icon: collection.icon
4456
+ })));
4457
+ }
4458
+ function openCollection(slug) {
4459
+ cui.gotoDetail("collection", slug);
4460
+ }
4461
+ function startCreateCollectionChat() {
4462
+ cui.startChat(t("collectionsView.addCollectionPrompt"), cui.generalRoleId);
4463
+ }
4464
+ (0, vue.onMounted)(loadCollections);
4465
+ return (_ctx, _cache) => {
4466
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, [(0, vue.createElementVNode)("div", _hoisted_2$1, [(0, vue.createElementVNode)("div", _hoisted_3$1, [(0, vue.createElementVNode)("h1", _hoisted_4$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.title")), 1), (0, vue.createElementVNode)("button", {
4467
+ type: "button",
4468
+ class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
4469
+ "data-testid": "collections-add-collection",
4470
+ onClick: startCreateCollectionChat
4471
+ }, [_cache[0] || (_cache[0] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "add", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.addCollectionLabel")), 1)])]), loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5$1, [_cache[1] || (_cache[1] = (0, vue.createElementVNode)("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.loading")), 1)])) : loadError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$1, [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.loadFailed")) + ": " + (0, vue.toDisplayString)(loadError.value), 1)])) : collections.value.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_7$1, [_cache[3] || (_cache[3] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300 mb-2" }, "dashboard_customize", -1)), (0, vue.createElementVNode)("p", _hoisted_8$1, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.indexEmpty")), 1)])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_9$1, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(collections.value, (collection) => {
4472
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4473
+ key: collection.slug,
4474
+ class: "group relative rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-indigo-300 transition-all duration-300 cursor-pointer flex items-center gap-4 focus:outline-none focus:ring-2 focus:ring-indigo-500/20",
4475
+ role: "button",
4476
+ tabindex: "0",
4477
+ "aria-label": (0, vue.unref)(t)("collectionsView.openCollection", { title: collection.title }),
4478
+ "data-testid": `collections-index-card-${collection.slug}`,
4479
+ onClick: ($event) => openCollection(collection.slug),
4480
+ onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(($event) => openCollection(collection.slug), ["self"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(($event) => openCollection(collection.slug), ["self", "prevent"]), ["space"])]
4481
+ }, [
4482
+ (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["absolute left-0 top-0 bottom-0 w-1 rounded-l-xl transition-all duration-300 group-hover:w-1.5", collection.source === "project" ? "bg-indigo-600" : "bg-violet-600"]) }, null, 2),
4483
+ (0, vue.createElementVNode)("div", { class: (0, vue.normalizeClass)(["h-12 w-12 flex items-center justify-center rounded-xl transition-all duration-300 group-hover:scale-105 shadow-sm", collection.source === "project" ? "bg-indigo-50 text-indigo-600 group-hover:bg-indigo-100/80 border border-indigo-100/50" : "bg-violet-50 text-violet-600 group-hover:bg-violet-100/80 border border-violet-100/50"]) }, [(0, vue.createElementVNode)("span", _hoisted_11$1, (0, vue.toDisplayString)(collection.icon), 1)], 2),
4484
+ (0, vue.createElementVNode)("div", _hoisted_12$1, [(0, vue.createElementVNode)("span", _hoisted_13$1, (0, vue.toDisplayString)(collection.title), 1), (0, vue.createElementVNode)("span", _hoisted_14$1, [
4485
+ (0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)(["h-1.5 w-1.5 rounded-full", collection.source === "project" ? "bg-indigo-500" : "bg-violet-500"]) }, null, 2),
4486
+ (0, vue.createTextVNode)(" " + (0, vue.toDisplayString)((0, vue.unref)(t)(`collectionsView.source.${collection.source}`)) + " · ", 1),
4487
+ (0, vue.createElementVNode)("code", _hoisted_15$1, (0, vue.toDisplayString)(collection.slug), 1)
4488
+ ])]),
4489
+ ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(pinToggle)), {
4490
+ kind: "collection",
4491
+ slug: collection.slug,
4492
+ title: collection.title,
4493
+ icon: collection.icon
4494
+ }, null, 8, [
4495
+ "slug",
4496
+ "title",
4497
+ "icon"
4498
+ ])),
4499
+ _cache[4] || (_cache[4] = (0, vue.createElementVNode)("div", { class: "h-8 w-8 flex items-center justify-center rounded-lg bg-slate-50 group-hover:bg-indigo-50 text-slate-400 group-hover:text-indigo-600 transition-all duration-300" }, [(0, vue.createElementVNode)("span", { class: "material-icons text-lg transition-transform duration-300 group-hover:translate-x-0.5" }, "chevron_right")], -1))
4500
+ ], 40, _hoisted_10$1);
4501
+ }), 128))]))])]);
4502
+ };
4503
+ }
4504
+ });
4505
+ //#endregion
4506
+ //#region src/vue/components/FeedsView.vue?vue&type=script&setup=true&lang.ts
4507
+ var _hoisted_1 = {
4508
+ class: "h-full overflow-y-auto bg-slate-50/50 px-6 py-6",
4509
+ "data-testid": "feeds-view-root"
4510
+ };
4511
+ var _hoisted_2 = { class: "max-w-4xl mx-auto" };
4512
+ var _hoisted_3 = { class: "flex items-center justify-between mb-6" };
4513
+ var _hoisted_4 = { class: "text-xl font-semibold text-slate-800" };
4514
+ var _hoisted_5 = {
4515
+ key: 0,
4516
+ class: "mb-4 flex items-center gap-2 rounded-xl border border-red-200 bg-red-50/50 p-3 text-sm text-red-800 shadow-sm",
4517
+ "data-testid": "feeds-refresh-error"
4518
+ };
4519
+ var _hoisted_6 = {
4520
+ key: 1,
4521
+ class: "flex flex-col items-center justify-center py-20 text-sm text-slate-500 gap-3"
4522
+ };
4523
+ var _hoisted_7 = {
4524
+ key: 2,
4525
+ class: "rounded-xl border border-red-200 bg-red-50/50 p-4 text-sm text-red-800 shadow-sm flex items-center gap-3"
4526
+ };
4527
+ var _hoisted_8 = {
4528
+ key: 3,
4529
+ class: "rounded-xl border border-slate-200 bg-white px-6 py-12 text-center text-sm text-slate-500 shadow-sm"
4530
+ };
4531
+ var _hoisted_9 = { class: "font-medium text-slate-700" };
4532
+ var _hoisted_10 = {
4533
+ key: 4,
4534
+ class: "grid gap-4 sm:grid-cols-2"
4535
+ };
4536
+ var _hoisted_11 = [
4537
+ "data-testid",
4538
+ "onClick",
4539
+ "onKeydown"
4540
+ ];
4541
+ var _hoisted_12 = { class: "h-12 w-12 flex items-center justify-center rounded-xl bg-indigo-50 text-indigo-600 border border-indigo-100/50" };
4542
+ var _hoisted_13 = { class: "material-symbols-outlined text-2xl" };
4543
+ var _hoisted_14 = { class: "flex-1 min-w-0" };
4544
+ var _hoisted_15 = { class: "block font-semibold text-slate-800 text-[15px] truncate" };
4545
+ var _hoisted_16 = { class: "block text-[10px] text-slate-400 mt-1 tracking-wider font-semibold uppercase" };
4546
+ var _hoisted_17 = [
4547
+ "disabled",
4548
+ "title",
4549
+ "aria-label",
4550
+ "data-testid",
4551
+ "onClick"
4552
+ ];
4553
+ var _hoisted_18 = { class: "material-icons text-lg" };
4554
+ var _hoisted_19 = { class: "w-full max-w-md rounded-xl bg-white p-5 shadow-xl" };
4555
+ var _hoisted_20 = { class: "text-sm font-semibold text-slate-800 mb-1" };
4556
+ var _hoisted_21 = { class: "text-xs text-slate-500 mb-3" };
4557
+ var _hoisted_22 = { class: "mt-4 flex justify-end gap-2" };
4558
+ var _hoisted_23 = ["disabled"];
4559
+ //#endregion
4560
+ //#region src/vue/components/FeedsView.vue
4561
+ var FeedsView_default = /* @__PURE__ */ (0, vue.defineComponent)({
4562
+ __name: "FeedsView",
4563
+ setup(__props) {
4564
+ const { t } = useCollectionI18n();
4565
+ const cui = collectionUi();
4566
+ const { pinToggle, reconcileShortcuts } = cui;
4567
+ const feeds = (0, vue.ref)([]);
4568
+ const loading = (0, vue.ref)(true);
4569
+ const loadError = (0, vue.ref)(null);
4570
+ const refreshingSlug = (0, vue.ref)(null);
4571
+ /** Non-destructive banner for a per-feed Refresh that failed (the
4572
+ * endpoint reports retriever errors via `errors` even on HTTP 200). */
4573
+ const refreshError = (0, vue.ref)(null);
4574
+ const addOpen = (0, vue.ref)(false);
4575
+ const addUrl = (0, vue.ref)("");
4576
+ const addInputEl = (0, vue.ref)(null);
4577
+ async function load() {
4578
+ loading.value = true;
4579
+ loadError.value = null;
4580
+ const result = await cui.listFeeds();
4581
+ loading.value = false;
4582
+ if (!result.ok) {
4583
+ loadError.value = result.error;
4584
+ return;
4585
+ }
4586
+ feeds.value = result.data.feeds;
4587
+ reconcileShortcuts("feed", feeds.value.map((feed) => ({
4588
+ slug: feed.slug,
4589
+ title: feed.title,
4590
+ icon: feed.icon || "dynamic_feed"
4591
+ })));
4592
+ }
4593
+ function open(slug) {
4594
+ cui.gotoDetail("feed", slug);
4595
+ }
4596
+ async function refresh(slug) {
4597
+ refreshingSlug.value = slug;
4598
+ refreshError.value = null;
4599
+ const result = await cui.refreshCollection(slug);
4600
+ refreshingSlug.value = null;
4601
+ if (!result.ok) {
4602
+ refreshError.value = t("collectionsView.refreshFailed", { error: result.error });
4603
+ return;
4604
+ }
4605
+ await load();
4606
+ if (result.data.errors.length > 0) refreshError.value = t("collectionsView.refreshFailed", { error: result.data.errors.join("; ") });
4607
+ }
4608
+ function startAddFeedChat() {
4609
+ addUrl.value = "";
4610
+ addOpen.value = true;
4611
+ (0, vue.nextTick)(() => addInputEl.value?.focus());
4612
+ }
4613
+ function closeAdd() {
4614
+ addOpen.value = false;
4615
+ }
4616
+ function submitAdd() {
4617
+ const url = addUrl.value.trim();
4618
+ if (!url) return;
4619
+ addOpen.value = false;
4620
+ cui.startChat(t("collectionsView.addFeedPrompt", { url }), cui.personalRoleId);
4621
+ }
4622
+ function formatTime(iso) {
4623
+ const date = new Date(iso);
4624
+ return Number.isNaN(date.getTime()) ? iso : date.toLocaleString();
4625
+ }
4626
+ (0, vue.onMounted)(load);
4627
+ return (_ctx, _cache) => {
4628
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1, [(0, vue.createElementVNode)("div", _hoisted_2, [
4629
+ (0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createElementVNode)("h1", _hoisted_4, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.feedsTitle")), 1), (0, vue.createElementVNode)("button", {
4630
+ type: "button",
4631
+ class: "h-8 px-2.5 flex items-center gap-1 rounded bg-indigo-600 hover:bg-indigo-700 text-white font-bold text-xs transition-colors shadow-sm",
4632
+ "data-testid": "feeds-add",
4633
+ onClick: startAddFeedChat
4634
+ }, [_cache[1] || (_cache[1] = (0, vue.createElementVNode)("span", { class: "material-icons text-sm" }, "add", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.add")), 1)])]),
4635
+ refreshError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_5, [_cache[2] || (_cache[2] = (0, vue.createElementVNode)("span", { class: "material-icons text-base text-red-600" }, "error", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)(refreshError.value), 1)])) : (0, vue.createCommentVNode)("", true),
4636
+ loading.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6, [_cache[3] || (_cache[3] = (0, vue.createElementVNode)("div", { class: "h-8 w-8 border-2 border-indigo-600/20 border-t-indigo-600 rounded-full animate-spin" }, null, -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("common.loading")), 1)])) : loadError.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_7, [_cache[4] || (_cache[4] = (0, vue.createElementVNode)("span", { class: "material-icons text-red-600" }, "error", -1)), (0, vue.createElementVNode)("span", null, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.loadFailed")) + ": " + (0, vue.toDisplayString)(loadError.value), 1)])) : feeds.value.length === 0 ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_8, [_cache[5] || (_cache[5] = (0, vue.createElementVNode)("span", { class: "material-icons text-4xl text-slate-300 mb-2" }, "dynamic_feed", -1)), (0, vue.createElementVNode)("p", _hoisted_9, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.feedsEmpty")), 1)])) : ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_10, [((0, vue.openBlock)(true), (0, vue.createElementBlock)(vue.Fragment, null, (0, vue.renderList)(feeds.value, (feed) => {
4637
+ return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4638
+ key: feed.slug,
4639
+ class: "group relative rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-indigo-300 transition-all duration-300 cursor-pointer flex items-center gap-4 focus:outline-none focus:ring-2 focus:ring-indigo-500/20",
4640
+ role: "button",
4641
+ tabindex: "0",
4642
+ "data-testid": `feeds-card-${feed.slug}`,
4643
+ onClick: ($event) => open(feed.slug),
4644
+ onKeydown: [(0, vue.withKeys)((0, vue.withModifiers)(($event) => open(feed.slug), ["self"]), ["enter"]), (0, vue.withKeys)((0, vue.withModifiers)(($event) => open(feed.slug), ["self", "prevent"]), ["space"])]
4645
+ }, [
4646
+ (0, vue.createElementVNode)("div", _hoisted_12, [(0, vue.createElementVNode)("span", _hoisted_13, (0, vue.toDisplayString)(feed.icon || "dynamic_feed"), 1)]),
4647
+ (0, vue.createElementVNode)("div", _hoisted_14, [(0, vue.createElementVNode)("span", _hoisted_15, (0, vue.toDisplayString)(feed.title), 1), (0, vue.createElementVNode)("span", _hoisted_16, [(0, vue.createTextVNode)((0, vue.toDisplayString)(feed.kind) + " · " + (0, vue.toDisplayString)(feed.schedule) + " ", 1), feed.lastFetchedAt ? ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 0 }, [(0, vue.createTextVNode)(" · " + (0, vue.toDisplayString)(formatTime(feed.lastFetchedAt)), 1)], 64)) : (0, vue.createCommentVNode)("", true)])]),
4648
+ ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(pinToggle)), {
4649
+ kind: "feed",
4650
+ slug: feed.slug,
4651
+ title: feed.title,
4652
+ icon: feed.icon || "dynamic_feed"
4653
+ }, null, 8, [
4654
+ "slug",
4655
+ "title",
4656
+ "icon"
4657
+ ])),
4658
+ (0, vue.createElementVNode)("button", {
4659
+ type: "button",
4660
+ class: "h-8 w-8 flex items-center justify-center rounded-lg bg-slate-50 hover:bg-indigo-50 text-slate-400 hover:text-indigo-600 transition-all duration-300 disabled:opacity-50",
4661
+ disabled: refreshingSlug.value === feed.slug,
4662
+ title: (0, vue.unref)(t)("collectionsView.refreshFeed"),
4663
+ "aria-label": (0, vue.unref)(t)("collectionsView.refreshFeed"),
4664
+ "data-testid": `feeds-refresh-${feed.slug}`,
4665
+ onClick: (0, vue.withModifiers)(($event) => refresh(feed.slug), ["stop"])
4666
+ }, [(0, vue.createElementVNode)("span", _hoisted_18, (0, vue.toDisplayString)(refreshingSlug.value === feed.slug ? "hourglass_empty" : "refresh"), 1)], 8, _hoisted_17)
4667
+ ], 40, _hoisted_11);
4668
+ }), 128))]))
4669
+ ]), addOpen.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", {
4670
+ key: 0,
4671
+ class: "fixed inset-0 z-40 flex items-center justify-center bg-black/30 p-4",
4672
+ onClick: (0, vue.withModifiers)(closeAdd, ["self"])
4673
+ }, [(0, vue.createElementVNode)("div", _hoisted_19, [
4674
+ (0, vue.createElementVNode)("h2", _hoisted_20, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.addFeedTitle")), 1),
4675
+ (0, vue.createElementVNode)("p", _hoisted_21, (0, vue.toDisplayString)((0, vue.unref)(t)("collectionsView.addFeedHint")), 1),
4676
+ (0, vue.withDirectives)((0, vue.createElementVNode)("input", {
4677
+ ref_key: "addInputEl",
4678
+ ref: addInputEl,
4679
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => addUrl.value = $event),
4680
+ type: "url",
4681
+ placeholder: "https://example.com/feed.xml",
4682
+ class: "w-full rounded border border-slate-200 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/20 focus:border-indigo-500",
4683
+ "data-testid": "feeds-add-url",
4684
+ onKeydown: [(0, vue.withKeys)(submitAdd, ["enter"]), (0, vue.withKeys)(closeAdd, ["esc"])]
4685
+ }, null, 544), [[vue.vModelText, addUrl.value]]),
4686
+ (0, vue.createElementVNode)("div", _hoisted_22, [(0, vue.createElementVNode)("button", {
4687
+ type: "button",
4688
+ class: "h-8 px-3 rounded text-xs font-medium text-slate-600 hover:bg-slate-100",
4689
+ onClick: closeAdd
4690
+ }, (0, vue.toDisplayString)((0, vue.unref)(t)("common.cancel")), 1), (0, vue.createElementVNode)("button", {
4691
+ type: "button",
4692
+ class: "h-8 px-3 rounded bg-indigo-600 hover:bg-indigo-700 text-white text-xs font-bold disabled:opacity-50",
4693
+ disabled: !addUrl.value.trim(),
4694
+ "data-testid": "feeds-add-submit",
4695
+ onClick: submitAdd
4696
+ }, (0, vue.toDisplayString)((0, vue.unref)(t)("common.add")), 9, _hoisted_23)])
4697
+ ])])) : (0, vue.createCommentVNode)("", true)]);
4698
+ };
4699
+ }
4700
+ });
4701
+ //#endregion
1614
4702
  exports.CollectionCalendarView = CollectionCalendarView_default;
4703
+ exports.CollectionCustomView = CollectionCustomView_default;
1615
4704
  exports.CollectionDayView = CollectionDayView_default;
1616
4705
  exports.CollectionEmbedView = CollectionEmbedView_default;
1617
4706
  exports.CollectionKanbanView = CollectionKanbanView_default;
1618
4707
  exports.CollectionRecordModal = CollectionRecordModal_default;
1619
4708
  exports.CollectionRecordPanel = CollectionRecordPanel_default;
4709
+ exports.CollectionView = CollectionView_default;
4710
+ exports.CollectionViewConfigModal = CollectionViewConfigModal_default;
4711
+ exports.CollectionsIndexView = CollectionsIndexView_default;
4712
+ exports.FeedsView = FeedsView_default;
1620
4713
  exports.collectionUi = collectionUi;
1621
4714
  exports.configureCollectionUi = configureCollectionUi;
4715
+ exports.readCollectionSort = readCollectionSort;
4716
+ exports.readCollectionViewMode = readCollectionViewMode;
1622
4717
  exports.useCollectionRendering = useCollectionRendering;
4718
+ exports.writeCollectionSort = writeCollectionSort;
4719
+ exports.writeCollectionViewMode = writeCollectionViewMode;
1623
4720
 
1624
4721
  //# sourceMappingURL=vue.cjs.map