@protobase/ui 0.111.0 → 0.111.2

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 (147) hide show
  1. package/dist/account/messages.d.ts +2 -2
  2. package/dist/app/change-confirm/messages.d.ts +2 -2
  3. package/dist/app/charts/messages.d.ts +2 -2
  4. package/dist/app/comments/messages.d.ts +2 -2
  5. package/dist/app/confirm-sign-in-messages.d.ts +2 -2
  6. package/dist/app/conversation/messages.d.ts +2 -2
  7. package/dist/app/conversation/thread-state.d.ts +1 -1
  8. package/dist/app/create/messages.d.ts +2 -2
  9. package/dist/app/custom-section.d.ts +1 -1
  10. package/dist/app/delete/messages.d.ts +2 -2
  11. package/dist/app/displays/list-cards.d.ts +1 -1
  12. package/dist/app/displays/messages.d.ts +2 -2
  13. package/dist/app/embedded-list/messages.d.ts +2 -2
  14. package/dist/app/export/messages.d.ts +2 -2
  15. package/dist/app/field-messages.d.ts +2 -2
  16. package/dist/app/field-types/runner-install/messages.d.ts +2 -2
  17. package/dist/app/field-types/widget-part.d.ts +1 -1
  18. package/dist/app/field-types/workflow/messages.d.ts +2 -2
  19. package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
  20. package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
  21. package/dist/app/file-viewers/messages.d.ts +2 -2
  22. package/dist/app/focus/messages.d.ts +2 -2
  23. package/dist/app/gallery/gallery-layout.d.ts +2 -2
  24. package/dist/app/gallery/messages.d.ts +2 -2
  25. package/dist/app/hand-order/messages.d.ts +2 -2
  26. package/dist/app/history/messages.d.ts +2 -2
  27. package/dist/app/import/messages.d.ts +2 -2
  28. package/dist/app/list-edit/messages.d.ts +2 -2
  29. package/dist/app/list-messages.d.ts +2 -2
  30. package/dist/app/messages.d.ts +2 -2
  31. package/dist/app/pages/custom-boundary.d.ts +1 -1
  32. package/dist/app/pages/custom-chosen.d.ts +1 -1
  33. package/dist/app/pages/guide/billing-config.d.ts +1 -1
  34. package/dist/app/pages/guide/billing-views.d.ts +1 -1
  35. package/dist/app/pages/messages.d.ts +2 -2
  36. package/dist/app/record-chart/messages.d.ts +2 -2
  37. package/dist/app/record-messages.d.ts +2 -2
  38. package/dist/app/record-mode/shown-layout.d.ts +1 -1
  39. package/dist/app/record-row/messages.d.ts +2 -2
  40. package/dist/app/related-cards/messages.d.ts +2 -2
  41. package/dist/app/runtime/messages.d.ts +2 -2
  42. package/dist/app/saved/messages.d.ts +2 -2
  43. package/dist/app/saved/saved-list.d.ts +1 -1
  44. package/dist/app/saved/use-favorite.d.ts +1 -1
  45. package/dist/app/search/messages.d.ts +2 -2
  46. package/dist/app/searches/messages.d.ts +2 -2
  47. package/dist/app/searches/use-save-search.d.ts +1 -1
  48. package/dist/app-shell/messages.d.ts +2 -2
  49. package/dist/assistant-dock/messages.d.ts +2 -2
  50. package/dist/auth/messages.d.ts +2 -2
  51. package/dist/calls/messages.d.ts +2 -2
  52. package/dist/chat/messages.d.ts +2 -2
  53. package/dist/data-grid/column-spec.d.ts +1 -1
  54. package/dist/data-grid/messages.d.ts +2 -2
  55. package/dist/filter-panel/messages.d.ts +2 -2
  56. package/dist/focus-page/messages.d.ts +2 -2
  57. package/dist/inline-child-table/messages.d.ts +2 -2
  58. package/dist/invitations/messages.d.ts +2 -2
  59. package/dist/live/messages.d.ts +2 -2
  60. package/dist/locale/en.js +8 -1
  61. package/dist/locale/en.json.d.ts +7 -0
  62. package/dist/locale/messages.d.ts +14 -0
  63. package/dist/locale/nl.js +8 -1
  64. package/dist/mailbox/messages.d.ts +2 -2
  65. package/dist/markdown/messages.d.ts +2 -2
  66. package/dist/mentions/messages.d.ts +2 -2
  67. package/dist/mocks/orders.d.ts +2 -2
  68. package/dist/notifications/bell/messages.d.ts +2 -2
  69. package/dist/organizations/messages.d.ts +2 -2
  70. package/dist/package.js +1 -1
  71. package/dist/plugins/before-sign-in.d.ts +1 -1
  72. package/dist/plugins/messages.d.ts +2 -2
  73. package/dist/primitives/messages.d.ts +2 -2
  74. package/dist/record-view/messages.d.ts +2 -2
  75. package/dist/shell/assets/{api-provider-BopdAXpc.js → api-provider-CcDtTh0D.js} +2 -2
  76. package/dist/shell/assets/{app-DvBSNKv4.js → app-Du-Fd1QD.js} +8 -8
  77. package/dist/shell/assets/{badge-B4ikYIDJ.js → badge-ChHXC28D.js} +2 -2
  78. package/dist/shell/assets/{checkbox-B23HcgB6.js → checkbox-COOOlJPG.js} +2 -2
  79. package/dist/shell/assets/{display-value-DoqvOXh1.js → display-value-fDiKbfJO.js} +2 -2
  80. package/dist/shell/assets/export-worker-BGjZsI8V.js +15 -0
  81. package/dist/shell/assets/{field-badge-Dhke0lFK.js → field-badge-3QmjR1r3.js} +2 -2
  82. package/dist/shell/assets/{graph-view-C62_GfJP.js → graph-view-CEo3E2az.js} +2 -2
  83. package/dist/shell/assets/{html-viewer-DeZA2hpx.js → html-viewer-kitQumwS.js} +2 -2
  84. package/dist/shell/assets/{in-place-form-BeGB_yB5.js → in-place-form-DkBB2sDN.js} +2 -2
  85. package/dist/shell/assets/{index-C5DbdNYC.js → index-C5uOKZWj.js} +2 -2
  86. package/dist/shell/assets/{intl-cache-ULd6cKG6.js → intl-cache-bXVNV0Yq.js} +2 -2
  87. package/dist/shell/assets/{maplibre-Atm1Bd80.js → maplibre-q_iehi3V.js} +2 -2
  88. package/dist/shell/assets/{markdown-content-CsA5RjRE.js → markdown-content-DgtMKGmV.js} +2 -2
  89. package/dist/shell/assets/messages-ClKBpZlk.js +2 -0
  90. package/dist/shell/assets/parse-worker-D7uEODYK.js +35 -0
  91. package/dist/shell/assets/{record-map-qX03dgUW.js → record-map-X0gQ1idf.js} +2 -2
  92. package/dist/shell/assets/{records-map-BOlSPSPq.js → records-map-Gb_4xMSf.js} +2 -2
  93. package/dist/shell/assets/{run-trace-view-dWg_Kpg0.js → run-trace-view-BadnYB2f.js} +2 -2
  94. package/dist/shell/assets/{search-picker-DhmnhZIV.js → search-picker-Cup7zlxY.js} +2 -2
  95. package/dist/shell/assets/{shared-protobase-ui-DQGTCVjM.js → shared-protobase-ui-BeXOZjFz.js} +2 -2
  96. package/dist/shell/assets/{step-catalog-jzR8hyXm.js → step-catalog-C1IXvKkP.js} +2 -2
  97. package/dist/shell/assets/{step-panel-DvHJZupU.js → step-panel-B46ysdoF.js} +2 -2
  98. package/dist/shell/assets/{use-app-address-EhuvnsNl.js → use-app-address-D50fN1nP.js} +2 -2
  99. package/dist/shell/assets/{use-meta-7JZ_HBay.js → use-meta-BqEqOLNe.js} +2 -2
  100. package/dist/shell/assets/{use-sibling-page-BVh6TxKT.js → use-sibling-page-CyN4ATqh.js} +2 -2
  101. package/dist/shell/assets/{value-badge-D3nfF_kP.js → value-badge-BKLV4otJ.js} +2 -2
  102. package/dist/shell/assets/{workflow-canvas-BpUGoiBb.js → workflow-canvas-cBkbjmNk.js} +2 -2
  103. package/dist/shell/assets/{workflow-graph-editor-Cw5Y_dyA.js → workflow-graph-editor-BflCDM8U.js} +2 -2
  104. package/dist/shell/assets/{workflow-workbench-yQujJv5u.js → workflow-workbench-B4S3OnRL.js} +2 -2
  105. package/dist/shell/index.html +12 -12
  106. package/dist/shell/protobase.shell.json +2 -2
  107. package/dist/shell/protobase.sw.js +2 -2
  108. package/dist/shell-source-maps/assets/{api-provider-BopdAXpc.js.map → api-provider-CcDtTh0D.js.map} +1 -1
  109. package/dist/shell-source-maps/assets/{app-DvBSNKv4.js.map → app-Du-Fd1QD.js.map} +1 -1
  110. package/dist/shell-source-maps/assets/{badge-B4ikYIDJ.js.map → badge-ChHXC28D.js.map} +1 -1
  111. package/dist/shell-source-maps/assets/{checkbox-B23HcgB6.js.map → checkbox-COOOlJPG.js.map} +1 -1
  112. package/dist/shell-source-maps/assets/{display-value-DoqvOXh1.js.map → display-value-fDiKbfJO.js.map} +1 -1
  113. package/dist/shell-source-maps/assets/export-worker-BGjZsI8V.js.map +1 -0
  114. package/dist/shell-source-maps/assets/{field-badge-Dhke0lFK.js.map → field-badge-3QmjR1r3.js.map} +1 -1
  115. package/dist/shell-source-maps/assets/{graph-view-C62_GfJP.js.map → graph-view-CEo3E2az.js.map} +1 -1
  116. package/dist/shell-source-maps/assets/{html-viewer-DeZA2hpx.js.map → html-viewer-kitQumwS.js.map} +1 -1
  117. package/dist/shell-source-maps/assets/{in-place-form-BeGB_yB5.js.map → in-place-form-DkBB2sDN.js.map} +1 -1
  118. package/dist/shell-source-maps/assets/{index-C5DbdNYC.js.map → index-C5uOKZWj.js.map} +1 -1
  119. package/dist/shell-source-maps/assets/{intl-cache-ULd6cKG6.js.map → intl-cache-bXVNV0Yq.js.map} +1 -1
  120. package/dist/shell-source-maps/assets/{maplibre-Atm1Bd80.js.map → maplibre-q_iehi3V.js.map} +1 -1
  121. package/dist/shell-source-maps/assets/{markdown-content-CsA5RjRE.js.map → markdown-content-DgtMKGmV.js.map} +1 -1
  122. package/dist/shell-source-maps/assets/messages-ClKBpZlk.js.map +1 -0
  123. package/dist/shell-source-maps/assets/parse-worker-D7uEODYK.js.map +1 -0
  124. package/dist/shell-source-maps/assets/{record-map-qX03dgUW.js.map → record-map-X0gQ1idf.js.map} +1 -1
  125. package/dist/shell-source-maps/assets/{records-map-BOlSPSPq.js.map → records-map-Gb_4xMSf.js.map} +1 -1
  126. package/dist/shell-source-maps/assets/{run-trace-view-dWg_Kpg0.js.map → run-trace-view-BadnYB2f.js.map} +1 -1
  127. package/dist/shell-source-maps/assets/{search-picker-DhmnhZIV.js.map → search-picker-Cup7zlxY.js.map} +1 -1
  128. package/dist/shell-source-maps/assets/{shared-protobase-ui-DQGTCVjM.js.map → shared-protobase-ui-BeXOZjFz.js.map} +1 -1
  129. package/dist/shell-source-maps/assets/{step-catalog-jzR8hyXm.js.map → step-catalog-C1IXvKkP.js.map} +1 -1
  130. package/dist/shell-source-maps/assets/{step-panel-DvHJZupU.js.map → step-panel-B46ysdoF.js.map} +1 -1
  131. package/dist/shell-source-maps/assets/{use-app-address-EhuvnsNl.js.map → use-app-address-D50fN1nP.js.map} +1 -1
  132. package/dist/shell-source-maps/assets/{use-meta-7JZ_HBay.js.map → use-meta-BqEqOLNe.js.map} +1 -1
  133. package/dist/shell-source-maps/assets/{use-sibling-page-BVh6TxKT.js.map → use-sibling-page-CyN4ATqh.js.map} +1 -1
  134. package/dist/shell-source-maps/assets/{value-badge-D3nfF_kP.js.map → value-badge-BKLV4otJ.js.map} +1 -1
  135. package/dist/shell-source-maps/assets/{workflow-canvas-BpUGoiBb.js.map → workflow-canvas-cBkbjmNk.js.map} +1 -1
  136. package/dist/shell-source-maps/assets/{workflow-graph-editor-Cw5Y_dyA.js.map → workflow-graph-editor-BflCDM8U.js.map} +1 -1
  137. package/dist/shell-source-maps/assets/{workflow-workbench-yQujJv5u.js.map → workflow-workbench-B4S3OnRL.js.map} +1 -1
  138. package/dist/status/messages.d.ts +2 -2
  139. package/dist/users/messages.d.ts +2 -2
  140. package/dist/website/list-screen.js +1 -1
  141. package/package.json +5 -5
  142. package/dist/shell/assets/export-worker-DcpuaeRz.js +0 -15
  143. package/dist/shell/assets/messages-Y1hA4dds.js +0 -2
  144. package/dist/shell/assets/parse-worker-B5yLKylw.js +0 -35
  145. package/dist/shell-source-maps/assets/export-worker-DcpuaeRz.js.map +0 -1
  146. package/dist/shell-source-maps/assets/messages-Y1hA4dds.js.map +0 -1
  147. package/dist/shell-source-maps/assets/parse-worker-B5yLKylw.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"badge-B4ikYIDJ.js","names":["n","a","t","__toESM","createLucideIcon","cn","__iconData","TriangleAlert","luminance","digits","hex","full","digit","g","b","channel","at","light","dark","readableOn","shade","background","import_jsx_runtime","require_jsx_runtime","tones","toneDots","arrow","Badge","color","shape","tone","className","dot","children"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/triangle-alert.mjs","../../../src/lib/readable-text.ts","../../../src/primitives/badge.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"triangle-alert\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n ],\n aliases: [\"alert-triangle\"]\n};\n__iconData.node;\nconst TriangleAlert = createLucideIcon(__iconData);\n\nexport { __iconData, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.mjs.map\n","// WCAG relative luminance of a `#rgb` or `#rrggbb` colour.\nconst luminance = (hex: string) => {\n const digits = hex.slice(1)\n const full = digits.length === 3 ? [...digits].map((digit) => digit + digit).join('') : digits\n const [r, g, b] = [0, 2, 4].map((at) => {\n const channel = Number.parseInt(full.slice(at, at + 2), 16) / 255\n return channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4\n })\n return 0.2126 * r! + 0.7152 * g! + 0.0722 * b!\n}\n\nconst light = '#ffffff'\nconst dark = '#111827'\n\n/** The text colour, white or near black, that reads best on a hex background. */\nexport const readableOn = (background: string) => {\n const shade = luminance(background)\n return (1.05 / (shade + 0.05) >= (shade + 0.05) / (luminance(dark) + 0.05) ? light : dark)\n}\n","import type { ReactNode } from 'react'\nimport type { BadgeTone } from '@protobase/schema'\nimport { cn } from '../lib/cn'\nimport { readableOn } from '../lib/readable-text'\n\nexport type { BadgeTone }\n\nconst tones: Record<BadgeTone, string> = {\n neutral: 'bg-muted text-muted-foreground',\n blue: 'bg-primary-soft text-primary-text',\n green: 'bg-success-soft text-success-text',\n amber: 'bg-warning-soft text-warning-text',\n red: 'bg-danger-soft text-danger-text',\n violet: 'bg-violet-soft text-violet-text',\n}\n\n/** The dot of a badge in each tone, for a status drawn as a dot alone. */\nexport const toneDots: Record<BadgeTone, string> = {\n neutral: 'bg-faint-foreground',\n blue: 'bg-primary',\n green: 'bg-success',\n amber: 'bg-warning',\n red: 'bg-danger',\n violet: 'bg-violet',\n}\n\n// An arrow pointing right, its point as deep as half the badge is high.\nconst arrow = 'polygon(0 0, calc(100% - 0.625rem) 0, 100% 50%, calc(100% - 0.625rem) 100%, 0 100%)'\n\ntype BadgeProps = {\n tone?: BadgeTone\n dot?: boolean\n /** A hex colour that fills the badge instead of its tone, its text white or near black, whichever reads. */\n color?: string\n /** `arrow` points the badge right, as on a rating scale. */\n shape?: 'arrow'\n children: ReactNode\n className?: string\n}\n\nexport const Badge = ({ tone = 'neutral', dot = true, color, shape, children, className }: BadgeProps) => (\n <span\n style={{ ...(color !== undefined && { backgroundColor: color, color: readableOn(color) }), ...(shape === 'arrow' && { clipPath: arrow }) }}\n className={cn(\n shape === 'arrow' ? 'inline-flex h-5 items-center gap-1.5 rounded-l-sm pr-4 pl-2 text-xs font-semibold whitespace-nowrap' : 'inline-flex h-5 items-center gap-1.5 rounded-full px-2 text-xs font-medium whitespace-nowrap',\n color === undefined && tones[tone],\n className,\n )}\n >\n {dot && color === undefined && shape === undefined && <span className={cn('size-1.5 rounded-full', toneDots[tone])} />}\n {children}\n </span>\n)\n"],"ignoreList":[0],"mappings":"6nBASA,IAAMM,EAAa,CACjB,KAAM,iBACN,KAAM,GACN,KAAM,CACJ,CACE,OACA,CACE,EAAG,2EACH,IAAK,QACP,CACF,EACA,CAAC,OAAQ,CAAE,EAAG,UAAW,IAAK,QAAS,CAAC,EACxC,CAAC,OAAQ,CAAE,EAAG,aAAc,IAAK,QAAS,CAAC,CAC7C,EACA,QAAS,CAAC,gBAAgB,CAC5B,EACAA,EAAW,KACX,IAAMC,EAAgBH,EAAiBE,CAAU,ECzB3CE,EAAa,GAAgB,CACjC,IAAMC,EAASC,EAAI,MAAM,CAAC,EACpBC,EAAOF,EAAO,SAAW,E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ACpHG,CACG","debugId":"788a4608-0c93-49db-aad7-6ad7013ea0a3"}
1
+ {"version":3,"file":"badge-ChHXC28D.js","names":["n","a","t","__toESM","createLucideIcon","cn","__iconData","TriangleAlert","luminance","digits","hex","full","digit","g","b","channel","at","light","dark","readableOn","shade","background","import_jsx_runtime","require_jsx_runtime","tones","toneDots","arrow","Badge","color","shape","tone","className","dot","children"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/triangle-alert.mjs","../../../src/lib/readable-text.ts","../../../src/primitives/badge.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"triangle-alert\",\n size: 24,\n node: [\n [\n \"path\",\n {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\",\n key: \"wmoenq\"\n }\n ],\n [\"path\", { d: \"M12 9v4\", key: \"juzpu7\" }],\n [\"path\", { d: \"M12 17h.01\", key: \"p32p05\" }]\n ],\n aliases: [\"alert-triangle\"]\n};\n__iconData.node;\nconst TriangleAlert = createLucideIcon(__iconData);\n\nexport { __iconData, TriangleAlert as default };\n//# sourceMappingURL=triangle-alert.mjs.map\n","// WCAG relative luminance of a `#rgb` or `#rrggbb` colour.\nconst luminance = (hex: string) => {\n const digits = hex.slice(1)\n const full = digits.length === 3 ? [...digits].map((digit) => digit + digit).join('') : digits\n const [r, g, b] = [0, 2, 4].map((at) => {\n const channel = Number.parseInt(full.slice(at, at + 2), 16) / 255\n return channel <= 0.03928 ? channel / 12.92 : ((channel + 0.055) / 1.055) ** 2.4\n })\n return 0.2126 * r! + 0.7152 * g! + 0.0722 * b!\n}\n\nconst light = '#ffffff'\nconst dark = '#111827'\n\n/** The text colour, white or near black, that reads best on a hex background. */\nexport const readableOn = (background: string) => {\n const shade = luminance(background)\n return (1.05 / (shade + 0.05) >= (shade + 0.05) / (luminance(dark) + 0.05) ? light : dark)\n}\n","import type { ReactNode } from 'react'\nimport type { BadgeTone } from '@protobase/schema'\nimport { cn } from '../lib/cn'\nimport { readableOn } from '../lib/readable-text'\n\nexport type { BadgeTone }\n\nconst tones: Record<BadgeTone, string> = {\n neutral: 'bg-muted text-muted-foreground',\n blue: 'bg-primary-soft text-primary-text',\n green: 'bg-success-soft text-success-text',\n amber: 'bg-warning-soft text-warning-text',\n red: 'bg-danger-soft text-danger-text',\n violet: 'bg-violet-soft text-violet-text',\n}\n\n/** The dot of a badge in each tone, for a status drawn as a dot alone. */\nexport const toneDots: Record<BadgeTone, string> = {\n neutral: 'bg-faint-foreground',\n blue: 'bg-primary',\n green: 'bg-success',\n amber: 'bg-warning',\n red: 'bg-danger',\n violet: 'bg-violet',\n}\n\n// An arrow pointing right, its point as deep as half the badge is high.\nconst arrow = 'polygon(0 0, calc(100% - 0.625rem) 0, 100% 50%, calc(100% - 0.625rem) 100%, 0 100%)'\n\ntype BadgeProps = {\n tone?: BadgeTone\n dot?: boolean\n /** A hex colour that fills the badge instead of its tone, its text white or near black, whichever reads. */\n color?: string\n /** `arrow` points the badge right, as on a rating scale. */\n shape?: 'arrow'\n children: ReactNode\n className?: string\n}\n\nexport const Badge = ({ tone = 'neutral', dot = true, color, shape, children, className }: BadgeProps) => (\n <span\n style={{ ...(color !== undefined && { backgroundColor: color, color: readableOn(color) }), ...(shape === 'arrow' && { clipPath: arrow }) }}\n className={cn(\n shape === 'arrow' ? 'inline-flex h-5 items-center gap-1.5 rounded-l-sm pr-4 pl-2 text-xs font-semibold whitespace-nowrap' : 'inline-flex h-5 items-center gap-1.5 rounded-full px-2 text-xs font-medium whitespace-nowrap',\n color === undefined && tones[tone],\n className,\n )}\n >\n {dot && color === undefined && shape === undefined && <span className={cn('size-1.5 rounded-full', toneDots[tone])} />}\n {children}\n </span>\n)\n"],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AA,KAAA,CAAC,OAAD,CACE,MAAO,CAAE,GAAIM,IAAU,IAAA,IAAa,CAAE,gBAAiBA,EAAO,MAAOT,EAAWS,CAAK,CAAE,EAAI,GAAIC,IAAU,SAAW,CAAE,SAAUH,CAAM,CAAG,EACzI,UAAWrB,EACTwB,IAAU,QAAU,sGAAwG,+FAC5HD,IAAU,IAAA,IAAaJ,EAAMM,GAC7BC,CACF,EANF,SAAA,CAQGC,GAAOJ,IAAU,IAAA,IAAaC,IAAU,IAAA,KAAa,EAAAP,EAAA,IAAA,CAAC,OAAD,CAAM,UAAWjB,EAAG,wBAAyBoB,EAASK,EAAK,CAAI,CAAA,EACpHG,CACG","debugId":"a11d70b6-f039-4c65-b285-8c6cc7c28c2f"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkbox-B23HcgB6.js","names":["__iconData","__iconData","__iconData","__iconData","createContext","useContext","isObject","n","a","t","__toESM","require_react","require_jsx_runtime","messages","createLucideIcon","cn","expressionSource","innerMachine","triggerSchema","orderOf","pinType","inputSchema","stepStatusSchema","resultSchema","parseReference","schemaAt","__iconData$4","Check","__iconData$3","CircleAlert","__iconData$2","LayoutGrid","__iconData$1","Minus","__iconData","X","import_react","FieldControlContext","useFieldControl","control","import_jsx_runtime","Input","rest","invalid","wrapperClassName","leading","className","trailing","Select","emptyDefinition","definitionOf","value","given","machine","States","start","recordDefinition","record","definitionRecord","_","withoutStart","definition","pathNames","path","pathOf","scope","name","splitPath","names","machineAt","stateAt","allNames","state","inner","pathOfName","other","found","holdsSteps","isObject$1","propertiesOf","schema","branches","own","entry","merged","field","branch","known","fields","fieldsOf","inputState","argumentsOf","inputPin","options","option","inputPins","schemas","required","args","key","outputsOf","stepOutputs","triggerOutputs","statusKey","conditionKey","statusPin","conditionPin","givenSchema","triggerLayoutKey","isObject","isPoint","pointsOf","point","workflowLayoutOf","views","keyPart","part","nameOf","id","pathPart","layoutKey","pure","withoutKey","layout","spacing","padding","overlaps","b","placedBoxes","moved","laidOut","boxes","box","children","parentOf","depth","parent","grown","ids","placed","others","under","group","width","height","text","Checkbox","indeterminate","checked","label","onChange"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/check.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/circle-alert.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/layout-grid.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/minus.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/x.mjs","../../../src/primitives/field-control.ts","../../../src/primitives/input.tsx","../../../src/primitives/select.tsx","../../../src/app/field-types/workflow/definition.ts","../../../src/app/field-types/workflow/pins/node-pins.ts","../../../src/app/field-types/workflow/manual-layout.ts","../../../src/app/field-types/workflow/messages.ts","../../../src/primitives/checkbox.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"check\",\n size: 24,\n node: [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]]\n};\n__iconData.node;\nconst Check = createLucideIcon(__iconData);\n\nexport { __iconData, Check as default };\n//# sourceMappingURL=check.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-alert\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n ],\n aliases: [\"alert-circle\"]\n};\n__iconData.node;\nconst CircleAlert = createLucideIcon(__iconData);\n\nexport { __iconData, CircleAlert as default };\n//# sourceMappingURL=circle-alert.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"layout-grid\",\n size: 24,\n node: [\n [\"rect\", { width: \"7\", height: \"7\", x: \"3\", y: \"3\", rx: \"1\", key: \"1g98yp\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"14\", y: \"3\", rx: \"1\", key: \"6d4xhi\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"14\", y: \"14\", rx: \"1\", key: \"nxv5o0\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"3\", y: \"14\", rx: \"1\", key: \"1bb6yr\" }]\n ]\n};\n__iconData.node;\nconst LayoutGrid = createLucideIcon(__iconData);\n\nexport { __iconData, LayoutGrid as default };\n//# sourceMappingURL=layout-grid.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"minus\",\n size: 24,\n node: [[\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }]]\n};\n__iconData.node;\nconst Minus = createLucideIcon(__iconData);\n\nexport { __iconData, Minus as default };\n//# sourceMappingURL=minus.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"x\",\n size: 24,\n node: [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n ]\n};\n__iconData.node;\nconst X = createLucideIcon(__iconData);\n\nexport { __iconData, X as default };\n//# sourceMappingURL=x.mjs.map\n","import { createContext, useContext } from 'react'\n\nexport type FieldControl = {\n id: string\n /** The form field's name, for the browser's autofill. */\n name?: string\n /** The ids of the help, example and error under the field. */\n describedBy?: string\n invalid: boolean\n required: boolean\n}\n\n/** Set by a form's `Field` for the control inside it. */\nexport const FieldControlContext = createContext<FieldControl | undefined>(undefined)\n\n/**\n * The attributes that tie a control to the `Field` around it: the id its label points at, its name, the help and error\n * that describe it, and whether it is invalid or required. None outside a `Field`.\n */\nexport const useFieldControl = () => {\n const control = useContext(FieldControlContext)\n if (!control) return {}\n return {\n id: control.id,\n name: control.name,\n 'aria-describedby': control.describedBy,\n 'aria-invalid': control.invalid || undefined,\n 'aria-required': control.required || undefined,\n }\n}\n","import type { InputHTMLAttributes, ReactNode, Ref } from 'react'\nimport { cn } from '../lib/cn'\nimport { useFieldControl } from './field-control'\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement> & { ref?: Ref<HTMLInputElement>; leading?: ReactNode; trailing?: ReactNode; invalid?: boolean; wrapperClassName?: string }\n\nexport const Input = ({ leading, trailing, invalid, className, wrapperClassName, ...rest }: InputProps) => {\n const control = useFieldControl()\n return (\n <span\n className={cn(\n 'flex h-8 items-center gap-2 rounded-md border bg-background px-2.5 text-muted-foreground shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/20',\n invalid ? 'border-danger' : 'border-border-strong',\n wrapperClassName,\n )}\n >\n {leading}\n <input className={cn('min-w-0 flex-1 bg-transparent text-body text-foreground outline-none placeholder:text-faint-foreground', className)} {...control} {...(invalid && { 'aria-invalid': true })} {...rest} />\n {trailing}\n </span>\n )\n}\n","import type { Ref, SelectHTMLAttributes } from 'react'\nimport { cn } from '../lib/cn'\nimport { useFieldControl } from './field-control'\n\nexport type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & { invalid?: boolean; ref?: Ref<HTMLSelectElement> }\n\n/** A native select as the field editors draw theirs; inside a `Field` it takes its label, help and error from it. */\nexport const Select = ({ invalid, className, children, ...rest }: SelectProps) => {\n const control = useFieldControl()\n return (\n <select\n {...control}\n {...(invalid && { 'aria-invalid': true })}\n className={cn('h-8 w-full min-w-0 rounded-md border bg-background px-2 shadow-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20', invalid ? 'border-danger' : 'border-border-strong', className)}\n {...rest}\n >\n {children}\n </select>\n )\n}\n","import { innerMachine, orderOf, type Definition, type Machine, type State } from '@protobase/workflows'\n\n/** A state's path: its name, after the names of the Maps and Blocks it is inside, joined by `/` as the definition check names it. */\nexport type StatePath = string\n\n/** The node of the workflow's trigger, which leads to the first state; no state path is empty. */\nexport const triggerId = ''\n\n/** What a workflow without a definition starts from: run by hand, and no state yet. */\nexport const emptyDefinition = (): Definition => ({ trigger: { manual: {} }, stateMachine: { QueryLanguage: 'JSONata', StartAt: '', States: {} } })\n\n/** The value as a definition to draw and edit: a workflow without one starts empty. */\nexport const definitionOf = (value: unknown): Definition => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return emptyDefinition()\n const given = value as Partial<Definition>\n const machine = given.stateMachine\n const States = typeof machine?.States === 'object' && machine.States !== null && !Array.isArray(machine.States) ? machine.States : {}\n // In data order a machine has no start, as it is saved\n const start = given.order === 'data' ? {} : { StartAt: machine?.StartAt ?? '' }\n return { ...given, trigger: given.trigger ?? { manual: {} }, stateMachine: { ...machine, QueryLanguage: 'JSONata', ...start, States } } as Definition\n}\n\n/**\n * A workflow's or a version's record as the definition to draw and edit, from the fields it keeps it in: its state\n * machine, trigger, execution order, connections and trace. One in data order is drawn with an empty `StartAt`, which\n * it is saved without.\n */\nexport const recordDefinition = (record: Record<string, unknown>): Definition =>\n definitionOf({\n trigger: record.trigger,\n order: record.execution_order ?? 'sequence',\n stateMachine: record.state_machine,\n ...(record.connections ? { connections: record.connections } : {}),\n ...(record.trace ? { trace: record.trace } : {}),\n })\n\n/** The fields a definition is saved in, as `recordDefinition` reads them: a state machine in data order has no `StartAt`. */\nexport const definitionRecord = (definition: Definition) => {\n const { StartAt: _, ...withoutStart } = definition.stateMachine\n return {\n state_machine: orderOf(definition) === 'data' ? withoutStart : definition.stateMachine,\n trigger: definition.trigger,\n execution_order: orderOf(definition),\n connections: definition.connections ?? null,\n trace: definition.trace ?? null,\n }\n}\n\n/** The names of a path, outermost first. */\nexport const pathNames = (path: StatePath) => path.split('/')\n\n/** The path of a state named `name` in the machine at `scope`, the path of a Map or Block or [] for the whole workflow. */\nexport const pathOf = (scope: readonly string[], name: string): StatePath => [...scope, name].join('/')\n\n/** The Maps and Blocks a path is inside, outermost first, and its own name. */\nexport const splitPath = (path: StatePath) => {\n const names = pathNames(path)\n return { scope: names.slice(0, -1), name: names.at(-1)! }\n}\n\n/** The machine at `scope`: the whole workflow's for [], else the steps of the Map or Block at that path. */\nexport const machineAt = (definition: Definition, scope: readonly string[]): Machine | undefined => {\n let machine: Machine | undefined = definition.stateMachine\n for (const name of scope) machine = innerMachine(machine?.States[name])\n return machine\n}\n\n/** The state at a path, when there is one. */\nexport const stateAt = (definition: Definition, path: StatePath): State | undefined => {\n const { scope, name } = splitPath(path)\n return machineAt(definition, scope)?.States[name]\n}\n\n/** Every state name, the ones inside Maps and Blocks too, which are unique across the whole definition. */\nexport const allNames = (machine: Machine): string[] =>\n Object.entries(machine.States).flatMap(([name, state]) => {\n const inner = innerMachine(state)\n return [name, ...(inner?.States ? allNames(inner) : [])]\n })\n\n/** The path of the state named `name`, wherever it is in the definition: names are unique across it. */\nexport const pathOfName = (machine: Machine, name: string, scope: readonly string[] = []): string[] | undefined => {\n if (Object.hasOwn(machine.States, name)) return [...scope, name]\n for (const [other, state] of Object.entries(machine.States)) {\n const inner = innerMachine(state)\n const found = inner?.States && pathOfName(inner, name, [...scope, other])\n if (found) return found\n }\n return\n}\n\n/** Whether a state holds steps of its own, drawn inside it: a Map's or a Block's. */\nexport const holdsSteps = (state: State | undefined) => state?.Type === 'Map' || state?.Type === 'Block'\n","import { expressionSource, inputSchema, parseReference, pinType, resultSchema, schemaAt, stepStatusSchema, triggerSchema, type Definition, type PinSchemas, type PinType, type State } from '@protobase/workflows'\n\ntype JsonSchema = Record<string, unknown>\n\n/**\n * What an input holds: nothing; a value of its own; an expression that computes; one read by name, drawn as a wire;\n * or an object whose fields read values, drawn as a Make node.\n */\nexport type InputState = 'empty' | 'literal' | 'expression' | 'wired' | 'made'\n\n/**\n * A pin on the left of a step: an argument of its type, with its type, whether the type needs it, and what it holds;\n * `statuses`: its options are what a step's status can be, shown by their names.\n */\nexport type InputPin = { key: string; type: PinType; required: boolean; value: unknown; state: InputState; options?: readonly string[]; statuses?: true }\n\n/** A pin on the right of a node: the value at `path` in what it gives, with its type. */\nexport type OutputPin = { path: string[]; type: PinType }\n\nconst isObject = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value)\n\n// The fields of an object a schema describes, or of the branches of its anyOf or oneOf, each name once: a field that\n// several branches declare takes any of their schemas.\nconst propertiesOf = (schema: JsonSchema | undefined): [string, JsonSchema][] => {\n if (!schema) return []\n const branches = [schema.anyOf, schema.oneOf].find(Array.isArray) as unknown[] | undefined\n const own = isObject(schema.properties) ? Object.entries(schema.properties).filter((entry): entry is [string, JsonSchema] => isObject(entry[1])) : []\n if (!branches) return own\n // The schema's own fields first, then each the branches add\n const merged = new Map<string, JsonSchema[]>(own.map(([name, field]) => [name, [field]]))\n for (const [name, field] of branches.filter(isObject).flatMap((branch) => propertiesOf(branch as JsonSchema))) if (!own.some(([known]) => known === name)) merged.set(name, [...(merged.get(name) ?? []), field])\n return [...merged].map(([name, fields]) => [name, fields.length === 1 ? fields[0]! : { anyOf: fields }])\n}\n\n/** The fields of an object a schema describes, each with its schema; none when it names none. */\nexport const fieldsOf = (schema: JsonSchema | undefined) => propertiesOf(schema)\n\n/** What an input's value is, as its pin shows it. */\nexport const inputState = (value: unknown): InputState => {\n if (value === undefined || value === '') return 'empty'\n if (parseReference(value)) return 'wired'\n if (expressionSource(value) !== undefined) return 'expression'\n // An object whose fields read values, by name alone or in an expression, is built by a Make node\n if (isObject(value) && Object.values(value).some((field) => expressionSource(field) !== undefined)) return 'made'\n return 'literal'\n}\n\nconst argumentsOf = (state: State): Record<string, unknown> => ('Arguments' in state && isObject(state.Arguments) ? state.Arguments : {})\n\n/** An input pin for the value at `key`, typed by its schema, with the choices an enum offers. */\nexport const inputPin = (key: string, schema: JsonSchema, value: unknown, required: boolean): InputPin => {\n const options = Array.isArray(schema.enum) && schema.enum.every((option) => typeof option === 'string') ? (schema.enum as string[]) : undefined\n return { key, type: pinType(schema), required, value, state: inputState(value), ...(options && { options }) }\n}\n\n/** A step's input pins: one per argument its type takes, in the order its schema declares them. */\nexport const inputPins = (state: State, schemas: PinSchemas): InputPin[] => {\n const schema = inputSchema(state, schemas)\n if (!schema) return []\n const required = Array.isArray(schema.required) ? (schema.required as string[]) : []\n const args = argumentsOf(state)\n return fieldsOf(schema).map(([key, field]) => inputPin(key, field, args[key], required.includes(key)))\n}\n\n// The pins of what a node gives: one per value it returns, as the fields of an untitled object, as a Blueprint's\n// function gives each output its own pin; one for the whole of a titled object, such as a record, which a Break takes apart.\nconst outputsOf = (schema: JsonSchema | undefined): OutputPin[] => {\n const fields = typeof schema?.title === 'string' ? [] : fieldsOf(schema)\n if (fields.length === 0) return [{ path: [], type: pinType(schema) }]\n return fields.map(([key, field]) => ({ path: [key], type: pinType(field) }))\n}\n\n/** What a step gives later steps by name: a Task's result by its type, a Map's or a Block's whole; nothing for the others. */\nexport const stepOutputs = (state: State, schemas: PinSchemas): OutputPin[] => {\n if (state.Type === 'Task') return outputsOf(resultSchema(state, schemas))\n if (state.Type === 'Map') return [{ path: [], type: pinType({ type: 'array' }) }]\n if (state.Type === 'Block') return [{ path: [], type: pinType(undefined) }]\n return []\n}\n\n/** What the trigger gives as the run's input: its fields by its type, or the whole input of a manual workflow. */\nexport const triggerOutputs = (definition: Definition, schemas: PinSchemas): OutputPin[] => outputsOf(triggerSchema(definition, schemas))\n\n/** In data order, the pin a state's status comes out of, and the one its Condition takes, which other values' pins never are. */\nexport const statusKey = '#status'\nexport const conditionKey = '#condition'\n\n/** A state's status pin, in data order: `$states.context.Steps.<name>`. */\nexport const statusPin: OutputPin = { path: [statusKey], type: pinType(stepStatusSchema) }\n\n/** A state's Only when pin, in data order: its Condition, true or false. */\nexport const conditionPin = (state: State): InputPin => ({ key: conditionKey, type: { kinds: ['boolean'] }, required: false, value: state.Condition, state: inputState(state.Condition) })\n\n/** The schema of the value at `path` of what a node gives, for its Break nodes: a Task's result, the run's input, or a state's status. */\nexport const givenSchema = (definition: Definition, state: State | undefined, schemas: PinSchemas, path: readonly string[]) => {\n if (path[0] === statusKey) return schemaAt(stepStatusSchema, path.slice(1))\n return schemaAt(state ? resultSchema(state, schemas) : triggerSchema(definition, schemas), path)\n}\n","import { splitPath, triggerId } from './definition'\nimport type { Box } from './graph-layout'\nimport type { PureNode } from './pins/data-graph'\nimport type { GraphView } from './pins/graph-view'\nimport { statusKey } from './pins/node-pins'\n\n/** Where a node's top left corner is, within the Map or Block it is inside or else the canvas. */\nexport type Point = { x: number; y: number }\n\n/** Where nodes were moved by hand in one view of the graph, by their layout keys: ELK lays out every node it does not name. */\nexport type ManualLayout = Readonly<Record<string, Point>>\n\n/**\n * A workflow's `layout` field, kept for everyone who edits it: the nodes moved by hand in each view of the graph, Pins\n * and Simple, each view's its own, so moving a node in one leaves it where it is in the other.\n */\nexport type WorkflowLayout = Readonly<Record<GraphView, ManualLayout>>\n\n/** The views a layout keeps, as its field holds them. */\nexport const layoutViews: readonly GraphView[] = ['pins', 'simple']\n\n/** The key of the trigger's node, and before the fields of the run's input that Break nodes take apart; no state's name. */\nexport const triggerLayoutKey = '$trigger'\n\nconst isObject = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst isPoint = (value: unknown): value is Point => isObject(value) && Number.isFinite(value.x) && Number.isFinite(value.y)\n\nconst pointsOf = (value: unknown): ManualLayout => (isObject(value) ? Object.fromEntries(Object.entries(value).flatMap(([key, point]) => (isPoint(point) ? [[key, { x: point.x, y: point.y }]] : []))) : {})\n\n/**\n * The layout a workflow's field holds, as its value or the JSON text a draft keeps it as: in each view, each position\n * with a finite `x` and `y`, read as those two alone, and nothing of what else it holds.\n */\nexport const workflowLayoutOf = (value: unknown): WorkflowLayout => {\n let given = value\n if (typeof value === 'string') {\n try {\n given = JSON.parse(value)\n } catch {\n given = undefined\n }\n }\n const views = isObject(given) ? given : {}\n return { pins: pointsOf(views.pins), simple: pointsOf(views.simple) }\n}\n\n/**\n * A name or a field as a part of a key: `%`, `.` and a leading `#` or `$` written as `%25`, `%2E`, `%23` and `%24`, so\n * a part is never read as two, and no part is taken for the trigger's key or a node's kind, which `#` starts.\n */\nexport const keyPart = (part: string) => part.replaceAll('%', '%25').replaceAll('.', '%2E').replace(/^#/, '%23').replace(/^\\$/, '%24')\n\n// A node's part of a key: a state's name, which is unique across the workflow, or the trigger's key\nconst nameOf = (id: string) => (id === triggerId ? triggerLayoutKey : keyPart(splitPath(id).name))\n\n// Where a value is in what a node gives, a status by its pin's own `#status`\nconst pathPart = (path: readonly string[]) => path.map((field) => (field === statusKey ? statusKey : keyPart(field)))\n\n/**\n * The key a node's position is kept under: a state's name; the trigger's key; a Break's the value it takes apart, such\n * as `Save.record`, or `Save.#break` for the whole of what a step gives; a Make's the argument it builds, such as\n * `Save.#make.data`; a Select's the argument it chooses, such as `Notify.#select.to`; and a condition node's its place among its step's Condition's nodes, such as `Tell.#when` for the\n * one wired to Only when and `Tell.#when.1` for the one at its second side. Every key but the trigger's starts with its\n * state's name, so a save drops those of a state removed.\n */\nexport const layoutKey = (id: string, pure?: PureNode) => {\n if (pure?.kind === 'break') return [nameOf(pure.source), ...(pure.path.length === 0 ? ['#break'] : pathPart(pure.path))].join('.')\n if (pure?.kind === 'make') return [nameOf(pure.target), '#make', keyPart(pure.key)].join('.')\n if (pure?.kind === 'select') return [nameOf(pure.target), '#select', keyPart(pure.key)].join('.')\n if (pure?.kind === 'condition') return [nameOf(pure.target), '#when', ...pure.at.map(String)].join('.')\n return nameOf(id)\n}\n\n/** The layout without a node's position, which ELK then lays out again. */\nexport const withoutKey = (layout: ManualLayout, key: string): ManualLayout => Object.fromEntries(Object.entries(layout).filter(([other]) => other !== key))\n\n// As ELK spaces nodes, and pads a Map or Block on its right and below\nconst spacing = 32\nconst padding = { right: 24, bottom: 24 }\n\nconst overlaps = (a: Box, b: Box) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height\n\n/**\n * The boxes ELK laid out, with the nodes moved by hand at their places: within each Map or Block, and on the canvas, a\n * node ELK laid out over one that was moved, or over a Map grown around it, goes down below it, and a Map or Block grows\n * around what was moved inside it. Without a node moved, ELK's boxes as they are.\n */\nexport const placedBoxes = (laidOut: ReadonlyMap<string, Box>, moved: ReadonlyMap<string, Point>, parentOf: (id: string) => string | undefined): ReadonlyMap<string, Box> => {\n if (![...moved.keys()].some((id) => laidOut.has(id))) return laidOut\n const boxes = new Map([...laidOut].map(([id, box]) => [id, { ...box, ...moved.get(id) }]))\n const children = new Map<string | undefined, string[]>()\n for (const id of boxes.keys()) children.set(parentOf(id), [...(children.get(parentOf(id)) ?? []), id])\n const depth = (parent: string | undefined): number => (parent === undefined ? 0 : depth(parentOf(parent)) + 1)\n const grown = new Set<string>()\n // The innermost first, so a Map grown inside another is placed at its new size\n for (const parent of [...children.keys()].sort((a, b) => depth(b) - depth(a))) {\n const ids = children.get(parent)!\n if (ids.some((id) => moved.has(id) || grown.has(id))) {\n const placed = ids.filter((id) => moved.has(id)).map((id) => boxes.get(id)!)\n const others = ids.filter((id) => !moved.has(id)).map((id) => boxes.get(id)!).sort((a, b) => a.y - b.y || a.x - b.x)\n for (const box of others) {\n let under = placed.find((other) => overlaps(box, other))\n while (under) {\n box.y = under.y + under.height + spacing\n under = placed.find((other) => overlaps(box, other))\n }\n placed.push(box)\n }\n }\n const group = parent === undefined ? undefined : boxes.get(parent)\n if (!group) continue\n const width = Math.max(group.width, ...ids.map((id) => boxes.get(id)!).map((box) => box.x + box.width + padding.right))\n const height = Math.max(group.height, ...ids.map((id) => boxes.get(id)!).map((box) => box.y + box.height + padding.bottom))\n if (width === group.width && height === group.height) continue\n Object.assign(group, { width, height })\n grown.add(parent!)\n }\n return boxes\n}\n","import { messages } from '../../../locale/messages'\n\nexport const text = messages('app/field-types/workflow')\n","import { Check, Minus } from 'lucide-react'\nimport { cn } from '../lib/cn'\n\nexport type CheckboxProps = { checked: boolean; indeterminate?: boolean; onChange?: (checked: boolean) => void; label?: string; disabled?: boolean; className?: string }\n\nexport const Checkbox = ({ checked, indeterminate, onChange, label, disabled, className }: CheckboxProps) => (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : checked}\n aria-label={label}\n disabled={disabled}\n onClick={() => onChange?.(!checked)}\n className={cn(\n 'relative inline-flex size-4 shrink-0 items-center justify-center rounded border transition-colors after:absolute after:-inset-1 after:content-[\"\"] pointer-coarse:after:-inset-3.5',\n checked || indeterminate ? 'border-primary bg-primary text-primary-foreground' : 'border-border-strong bg-background hover:border-faint-foreground',\n className,\n )}\n >\n {indeterminate ? <Minus className=\"size-3\" strokeWidth={3} /> : checked && <Check className=\"size-3\" strokeWidth={3} />}\n </button>\n)\n"],"ignoreList":[0,1,2,3,4],"mappings":"mwBASA,IAAMA,EAAa,CACjB,KAAM,QACN,KAAM,GACN,KAAM,CAAC,CAAC,OAAQ,CAAE,EAAG,kBAAmB,IAAK,QAAS,CAAC,CAAC,CAC1D,EACAA,EAAW,KACX,IAAM2B,EAAQb,EAAiBd,CAAU,ECNnCC,EAAa,CACjB,KAAM,eACN,KAAM,GACN,KAAM,CACJ,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAA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,CAAE,CAAC,CAAC,IAAK,GAAQc,EAAI,EAAIA,EAAI,MAAQP,EAAQ,KAAK,CAAC,EAChHmB,EAAS,KAAK,IAAIF,EAAM,OAAQ,GAAGJ,EAAI,IAAK,GAAOP,EAAM,IAAIb,CAAE,CAAE,CAAC,CAAC,IAAK,GAAQc,EAAI,EAAIA,EAAI,OAASP,EAAQ,MAAM,CAAC,GACtHkB,IAAUD,EAAM,OAASE,IAAWF,EAAM,UAC9C,OAAO,OAAOA,EAAO,CAAE,QAAO,QAAO,CAAC,EACtCL,EAAM,IAAID,CAAO,EACnB,CACA,OAAOL,CACT,ECrHac,GAAOpI,EAAS,0BAA0B,ECG1CqI,IAAY,CAAE,UAAS,gBAAe,WAAU,QAAO,WAAU,gBAC5E,EAAA1G,EAAA,IAAA,CAAC,SAAD,CACE,KAAK,SACL,KAAK,WACL,eAAc2G,EAAgB,QAAUC,EACxC,aAAYC,EACF,WACV,YAAeC,IAAW,CAACF,CAAO,EAClC,UAAWrI,EACT,qLACAqI,GAAWD,EAAgB,oDAAsD,mEACjFrG,CACF,EAEC,SAAAqG,GAAgB,EAAA3G,EAAA,IAAA,CAACP,EAAD,CAAO,UAAU,SAAS,YAAa,CAAI,CAAA,EAAImH,IAAW,EAAA5G,EAAA,IAAA,CAACb,EAAD,CAAO,UAAU,SAAS,YAAa,CAAI,CAAA,CAChH,CAAA","debugId":"76dc7720-07a4-4a35-bc92-4f2a698e573f"}
1
+ {"version":3,"file":"checkbox-COOOlJPG.js","names":["__iconData","__iconData","__iconData","__iconData","createContext","useContext","isObject","n","a","t","__toESM","require_react","require_jsx_runtime","messages","createLucideIcon","cn","expressionSource","innerMachine","triggerSchema","orderOf","pinType","inputSchema","stepStatusSchema","resultSchema","parseReference","schemaAt","__iconData$4","Check","__iconData$3","CircleAlert","__iconData$2","LayoutGrid","__iconData$1","Minus","__iconData","X","import_react","FieldControlContext","useFieldControl","control","import_jsx_runtime","Input","rest","invalid","wrapperClassName","leading","className","trailing","Select","emptyDefinition","definitionOf","value","given","machine","States","start","recordDefinition","record","definitionRecord","_","withoutStart","definition","pathNames","path","pathOf","scope","name","splitPath","names","machineAt","stateAt","allNames","state","inner","pathOfName","other","found","holdsSteps","isObject$1","propertiesOf","schema","branches","own","entry","merged","field","branch","known","fields","fieldsOf","inputState","argumentsOf","inputPin","options","option","inputPins","schemas","required","args","key","outputsOf","stepOutputs","triggerOutputs","statusKey","conditionKey","statusPin","conditionPin","givenSchema","triggerLayoutKey","isObject","isPoint","pointsOf","point","workflowLayoutOf","views","keyPart","part","nameOf","id","pathPart","layoutKey","pure","withoutKey","layout","spacing","padding","overlaps","b","placedBoxes","moved","laidOut","boxes","box","children","parentOf","depth","parent","grown","ids","placed","others","under","group","width","height","text","Checkbox","indeterminate","checked","label","onChange"],"sources":["../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/check.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/circle-alert.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/layout-grid.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/minus.mjs","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/x.mjs","../../../src/primitives/field-control.ts","../../../src/primitives/input.tsx","../../../src/primitives/select.tsx","../../../src/app/field-types/workflow/definition.ts","../../../src/app/field-types/workflow/pins/node-pins.ts","../../../src/app/field-types/workflow/manual-layout.ts","../../../src/app/field-types/workflow/messages.ts","../../../src/primitives/checkbox.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"check\",\n size: 24,\n node: [[\"path\", { d: \"M20 6 9 17l-5-5\", key: \"1gmf2c\" }]]\n};\n__iconData.node;\nconst Check = createLucideIcon(__iconData);\n\nexport { __iconData, Check as default };\n//# sourceMappingURL=check.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"circle-alert\",\n size: 24,\n node: [\n [\"circle\", { cx: \"12\", cy: \"12\", r: \"10\", key: \"1mglay\" }],\n [\"line\", { x1: \"12\", x2: \"12\", y1: \"8\", y2: \"12\", key: \"1pkeuh\" }],\n [\"line\", { x1: \"12\", x2: \"12.01\", y1: \"16\", y2: \"16\", key: \"4dfq90\" }]\n ],\n aliases: [\"alert-circle\"]\n};\n__iconData.node;\nconst CircleAlert = createLucideIcon(__iconData);\n\nexport { __iconData, CircleAlert as default };\n//# sourceMappingURL=circle-alert.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"layout-grid\",\n size: 24,\n node: [\n [\"rect\", { width: \"7\", height: \"7\", x: \"3\", y: \"3\", rx: \"1\", key: \"1g98yp\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"14\", y: \"3\", rx: \"1\", key: \"6d4xhi\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"14\", y: \"14\", rx: \"1\", key: \"nxv5o0\" }],\n [\"rect\", { width: \"7\", height: \"7\", x: \"3\", y: \"14\", rx: \"1\", key: \"1bb6yr\" }]\n ]\n};\n__iconData.node;\nconst LayoutGrid = createLucideIcon(__iconData);\n\nexport { __iconData, LayoutGrid as default };\n//# sourceMappingURL=layout-grid.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"minus\",\n size: 24,\n node: [[\"path\", { d: \"M5 12h14\", key: \"1ays0h\" }]]\n};\n__iconData.node;\nconst Minus = createLucideIcon(__iconData);\n\nexport { __iconData, Minus as default };\n//# sourceMappingURL=minus.mjs.map\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"x\",\n size: 24,\n node: [\n [\"path\", { d: \"M18 6 6 18\", key: \"1bl5f8\" }],\n [\"path\", { d: \"m6 6 12 12\", key: \"d8bk6v\" }]\n ]\n};\n__iconData.node;\nconst X = createLucideIcon(__iconData);\n\nexport { __iconData, X as default };\n//# sourceMappingURL=x.mjs.map\n","import { createContext, useContext } from 'react'\n\nexport type FieldControl = {\n id: string\n /** The form field's name, for the browser's autofill. */\n name?: string\n /** The ids of the help, example and error under the field. */\n describedBy?: string\n invalid: boolean\n required: boolean\n}\n\n/** Set by a form's `Field` for the control inside it. */\nexport const FieldControlContext = createContext<FieldControl | undefined>(undefined)\n\n/**\n * The attributes that tie a control to the `Field` around it: the id its label points at, its name, the help and error\n * that describe it, and whether it is invalid or required. None outside a `Field`.\n */\nexport const useFieldControl = () => {\n const control = useContext(FieldControlContext)\n if (!control) return {}\n return {\n id: control.id,\n name: control.name,\n 'aria-describedby': control.describedBy,\n 'aria-invalid': control.invalid || undefined,\n 'aria-required': control.required || undefined,\n }\n}\n","import type { InputHTMLAttributes, ReactNode, Ref } from 'react'\nimport { cn } from '../lib/cn'\nimport { useFieldControl } from './field-control'\n\nexport type InputProps = InputHTMLAttributes<HTMLInputElement> & { ref?: Ref<HTMLInputElement>; leading?: ReactNode; trailing?: ReactNode; invalid?: boolean; wrapperClassName?: string }\n\nexport const Input = ({ leading, trailing, invalid, className, wrapperClassName, ...rest }: InputProps) => {\n const control = useFieldControl()\n return (\n <span\n className={cn(\n 'flex h-8 items-center gap-2 rounded-md border bg-background px-2.5 text-muted-foreground shadow-sm focus-within:border-primary focus-within:ring-2 focus-within:ring-primary/20',\n invalid ? 'border-danger' : 'border-border-strong',\n wrapperClassName,\n )}\n >\n {leading}\n <input className={cn('min-w-0 flex-1 bg-transparent text-body text-foreground outline-none placeholder:text-faint-foreground', className)} {...control} {...(invalid && { 'aria-invalid': true })} {...rest} />\n {trailing}\n </span>\n )\n}\n","import type { Ref, SelectHTMLAttributes } from 'react'\nimport { cn } from '../lib/cn'\nimport { useFieldControl } from './field-control'\n\nexport type SelectProps = SelectHTMLAttributes<HTMLSelectElement> & { invalid?: boolean; ref?: Ref<HTMLSelectElement> }\n\n/** A native select as the field editors draw theirs; inside a `Field` it takes its label, help and error from it. */\nexport const Select = ({ invalid, className, children, ...rest }: SelectProps) => {\n const control = useFieldControl()\n return (\n <select\n {...control}\n {...(invalid && { 'aria-invalid': true })}\n className={cn('h-8 w-full min-w-0 rounded-md border bg-background px-2 shadow-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20', invalid ? 'border-danger' : 'border-border-strong', className)}\n {...rest}\n >\n {children}\n </select>\n )\n}\n","import { innerMachine, orderOf, type Definition, type Machine, type State } from '@protobase/workflows'\n\n/** A state's path: its name, after the names of the Maps and Blocks it is inside, joined by `/` as the definition check names it. */\nexport type StatePath = string\n\n/** The node of the workflow's trigger, which leads to the first state; no state path is empty. */\nexport const triggerId = ''\n\n/** What a workflow without a definition starts from: run by hand, and no state yet. */\nexport const emptyDefinition = (): Definition => ({ trigger: { manual: {} }, stateMachine: { QueryLanguage: 'JSONata', StartAt: '', States: {} } })\n\n/** The value as a definition to draw and edit: a workflow without one starts empty. */\nexport const definitionOf = (value: unknown): Definition => {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return emptyDefinition()\n const given = value as Partial<Definition>\n const machine = given.stateMachine\n const States = typeof machine?.States === 'object' && machine.States !== null && !Array.isArray(machine.States) ? machine.States : {}\n // In data order a machine has no start, as it is saved\n const start = given.order === 'data' ? {} : { StartAt: machine?.StartAt ?? '' }\n return { ...given, trigger: given.trigger ?? { manual: {} }, stateMachine: { ...machine, QueryLanguage: 'JSONata', ...start, States } } as Definition\n}\n\n/**\n * A workflow's or a version's record as the definition to draw and edit, from the fields it keeps it in: its state\n * machine, trigger, execution order, connections and trace. One in data order is drawn with an empty `StartAt`, which\n * it is saved without.\n */\nexport const recordDefinition = (record: Record<string, unknown>): Definition =>\n definitionOf({\n trigger: record.trigger,\n order: record.execution_order ?? 'sequence',\n stateMachine: record.state_machine,\n ...(record.connections ? { connections: record.connections } : {}),\n ...(record.trace ? { trace: record.trace } : {}),\n })\n\n/** The fields a definition is saved in, as `recordDefinition` reads them: a state machine in data order has no `StartAt`. */\nexport const definitionRecord = (definition: Definition) => {\n const { StartAt: _, ...withoutStart } = definition.stateMachine\n return {\n state_machine: orderOf(definition) === 'data' ? withoutStart : definition.stateMachine,\n trigger: definition.trigger,\n execution_order: orderOf(definition),\n connections: definition.connections ?? null,\n trace: definition.trace ?? null,\n }\n}\n\n/** The names of a path, outermost first. */\nexport const pathNames = (path: StatePath) => path.split('/')\n\n/** The path of a state named `name` in the machine at `scope`, the path of a Map or Block or [] for the whole workflow. */\nexport const pathOf = (scope: readonly string[], name: string): StatePath => [...scope, name].join('/')\n\n/** The Maps and Blocks a path is inside, outermost first, and its own name. */\nexport const splitPath = (path: StatePath) => {\n const names = pathNames(path)\n return { scope: names.slice(0, -1), name: names.at(-1)! }\n}\n\n/** The machine at `scope`: the whole workflow's for [], else the steps of the Map or Block at that path. */\nexport const machineAt = (definition: Definition, scope: readonly string[]): Machine | undefined => {\n let machine: Machine | undefined = definition.stateMachine\n for (const name of scope) machine = innerMachine(machine?.States[name])\n return machine\n}\n\n/** The state at a path, when there is one. */\nexport const stateAt = (definition: Definition, path: StatePath): State | undefined => {\n const { scope, name } = splitPath(path)\n return machineAt(definition, scope)?.States[name]\n}\n\n/** Every state name, the ones inside Maps and Blocks too, which are unique across the whole definition. */\nexport const allNames = (machine: Machine): string[] =>\n Object.entries(machine.States).flatMap(([name, state]) => {\n const inner = innerMachine(state)\n return [name, ...(inner?.States ? allNames(inner) : [])]\n })\n\n/** The path of the state named `name`, wherever it is in the definition: names are unique across it. */\nexport const pathOfName = (machine: Machine, name: string, scope: readonly string[] = []): string[] | undefined => {\n if (Object.hasOwn(machine.States, name)) return [...scope, name]\n for (const [other, state] of Object.entries(machine.States)) {\n const inner = innerMachine(state)\n const found = inner?.States && pathOfName(inner, name, [...scope, other])\n if (found) return found\n }\n return\n}\n\n/** Whether a state holds steps of its own, drawn inside it: a Map's or a Block's. */\nexport const holdsSteps = (state: State | undefined) => state?.Type === 'Map' || state?.Type === 'Block'\n","import { expressionSource, inputSchema, parseReference, pinType, resultSchema, schemaAt, stepStatusSchema, triggerSchema, type Definition, type PinSchemas, type PinType, type State } from '@protobase/workflows'\n\ntype JsonSchema = Record<string, unknown>\n\n/**\n * What an input holds: nothing; a value of its own; an expression that computes; one read by name, drawn as a wire;\n * or an object whose fields read values, drawn as a Make node.\n */\nexport type InputState = 'empty' | 'literal' | 'expression' | 'wired' | 'made'\n\n/**\n * A pin on the left of a step: an argument of its type, with its type, whether the type needs it, and what it holds;\n * `statuses`: its options are what a step's status can be, shown by their names.\n */\nexport type InputPin = { key: string; type: PinType; required: boolean; value: unknown; state: InputState; options?: readonly string[]; statuses?: true }\n\n/** A pin on the right of a node: the value at `path` in what it gives, with its type. */\nexport type OutputPin = { path: string[]; type: PinType }\n\nconst isObject = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value)\n\n// The fields of an object a schema describes, or of the branches of its anyOf or oneOf, each name once: a field that\n// several branches declare takes any of their schemas.\nconst propertiesOf = (schema: JsonSchema | undefined): [string, JsonSchema][] => {\n if (!schema) return []\n const branches = [schema.anyOf, schema.oneOf].find(Array.isArray) as unknown[] | undefined\n const own = isObject(schema.properties) ? Object.entries(schema.properties).filter((entry): entry is [string, JsonSchema] => isObject(entry[1])) : []\n if (!branches) return own\n // The schema's own fields first, then each the branches add\n const merged = new Map<string, JsonSchema[]>(own.map(([name, field]) => [name, [field]]))\n for (const [name, field] of branches.filter(isObject).flatMap((branch) => propertiesOf(branch as JsonSchema))) if (!own.some(([known]) => known === name)) merged.set(name, [...(merged.get(name) ?? []), field])\n return [...merged].map(([name, fields]) => [name, fields.length === 1 ? fields[0]! : { anyOf: fields }])\n}\n\n/** The fields of an object a schema describes, each with its schema; none when it names none. */\nexport const fieldsOf = (schema: JsonSchema | undefined) => propertiesOf(schema)\n\n/** What an input's value is, as its pin shows it. */\nexport const inputState = (value: unknown): InputState => {\n if (value === undefined || value === '') return 'empty'\n if (parseReference(value)) return 'wired'\n if (expressionSource(value) !== undefined) return 'expression'\n // An object whose fields read values, by name alone or in an expression, is built by a Make node\n if (isObject(value) && Object.values(value).some((field) => expressionSource(field) !== undefined)) return 'made'\n return 'literal'\n}\n\nconst argumentsOf = (state: State): Record<string, unknown> => ('Arguments' in state && isObject(state.Arguments) ? state.Arguments : {})\n\n/** An input pin for the value at `key`, typed by its schema, with the choices an enum offers. */\nexport const inputPin = (key: string, schema: JsonSchema, value: unknown, required: boolean): InputPin => {\n const options = Array.isArray(schema.enum) && schema.enum.every((option) => typeof option === 'string') ? (schema.enum as string[]) : undefined\n return { key, type: pinType(schema), required, value, state: inputState(value), ...(options && { options }) }\n}\n\n/** A step's input pins: one per argument its type takes, in the order its schema declares them. */\nexport const inputPins = (state: State, schemas: PinSchemas): InputPin[] => {\n const schema = inputSchema(state, schemas)\n if (!schema) return []\n const required = Array.isArray(schema.required) ? (schema.required as string[]) : []\n const args = argumentsOf(state)\n return fieldsOf(schema).map(([key, field]) => inputPin(key, field, args[key], required.includes(key)))\n}\n\n// The pins of what a node gives: one per value it returns, as the fields of an untitled object, as a Blueprint's\n// function gives each output its own pin; one for the whole of a titled object, such as a record, which a Break takes apart.\nconst outputsOf = (schema: JsonSchema | undefined): OutputPin[] => {\n const fields = typeof schema?.title === 'string' ? [] : fieldsOf(schema)\n if (fields.length === 0) return [{ path: [], type: pinType(schema) }]\n return fields.map(([key, field]) => ({ path: [key], type: pinType(field) }))\n}\n\n/** What a step gives later steps by name: a Task's result by its type, a Map's or a Block's whole; nothing for the others. */\nexport const stepOutputs = (state: State, schemas: PinSchemas): OutputPin[] => {\n if (state.Type === 'Task') return outputsOf(resultSchema(state, schemas))\n if (state.Type === 'Map') return [{ path: [], type: pinType({ type: 'array' }) }]\n if (state.Type === 'Block') return [{ path: [], type: pinType(undefined) }]\n return []\n}\n\n/** What the trigger gives as the run's input: its fields by its type, or the whole input of a manual workflow. */\nexport const triggerOutputs = (definition: Definition, schemas: PinSchemas): OutputPin[] => outputsOf(triggerSchema(definition, schemas))\n\n/** In data order, the pin a state's status comes out of, and the one its Condition takes, which other values' pins never are. */\nexport const statusKey = '#status'\nexport const conditionKey = '#condition'\n\n/** A state's status pin, in data order: `$states.context.Steps.<name>`. */\nexport const statusPin: OutputPin = { path: [statusKey], type: pinType(stepStatusSchema) }\n\n/** A state's Only when pin, in data order: its Condition, true or false. */\nexport const conditionPin = (state: State): InputPin => ({ key: conditionKey, type: { kinds: ['boolean'] }, required: false, value: state.Condition, state: inputState(state.Condition) })\n\n/** The schema of the value at `path` of what a node gives, for its Break nodes: a Task's result, the run's input, or a state's status. */\nexport const givenSchema = (definition: Definition, state: State | undefined, schemas: PinSchemas, path: readonly string[]) => {\n if (path[0] === statusKey) return schemaAt(stepStatusSchema, path.slice(1))\n return schemaAt(state ? resultSchema(state, schemas) : triggerSchema(definition, schemas), path)\n}\n","import { splitPath, triggerId } from './definition'\nimport type { Box } from './graph-layout'\nimport type { PureNode } from './pins/data-graph'\nimport type { GraphView } from './pins/graph-view'\nimport { statusKey } from './pins/node-pins'\n\n/** Where a node's top left corner is, within the Map or Block it is inside or else the canvas. */\nexport type Point = { x: number; y: number }\n\n/** Where nodes were moved by hand in one view of the graph, by their layout keys: ELK lays out every node it does not name. */\nexport type ManualLayout = Readonly<Record<string, Point>>\n\n/**\n * A workflow's `layout` field, kept for everyone who edits it: the nodes moved by hand in each view of the graph, Pins\n * and Simple, each view's its own, so moving a node in one leaves it where it is in the other.\n */\nexport type WorkflowLayout = Readonly<Record<GraphView, ManualLayout>>\n\n/** The views a layout keeps, as its field holds them. */\nexport const layoutViews: readonly GraphView[] = ['pins', 'simple']\n\n/** The key of the trigger's node, and before the fields of the run's input that Break nodes take apart; no state's name. */\nexport const triggerLayoutKey = '$trigger'\n\nconst isObject = (value: unknown): value is Record<string, unknown> => typeof value === 'object' && value !== null && !Array.isArray(value)\n\nconst isPoint = (value: unknown): value is Point => isObject(value) && Number.isFinite(value.x) && Number.isFinite(value.y)\n\nconst pointsOf = (value: unknown): ManualLayout => (isObject(value) ? Object.fromEntries(Object.entries(value).flatMap(([key, point]) => (isPoint(point) ? [[key, { x: point.x, y: point.y }]] : []))) : {})\n\n/**\n * The layout a workflow's field holds, as its value or the JSON text a draft keeps it as: in each view, each position\n * with a finite `x` and `y`, read as those two alone, and nothing of what else it holds.\n */\nexport const workflowLayoutOf = (value: unknown): WorkflowLayout => {\n let given = value\n if (typeof value === 'string') {\n try {\n given = JSON.parse(value)\n } catch {\n given = undefined\n }\n }\n const views = isObject(given) ? given : {}\n return { pins: pointsOf(views.pins), simple: pointsOf(views.simple) }\n}\n\n/**\n * A name or a field as a part of a key: `%`, `.` and a leading `#` or `$` written as `%25`, `%2E`, `%23` and `%24`, so\n * a part is never read as two, and no part is taken for the trigger's key or a node's kind, which `#` starts.\n */\nexport const keyPart = (part: string) => part.replaceAll('%', '%25').replaceAll('.', '%2E').replace(/^#/, '%23').replace(/^\\$/, '%24')\n\n// A node's part of a key: a state's name, which is unique across the workflow, or the trigger's key\nconst nameOf = (id: string) => (id === triggerId ? triggerLayoutKey : keyPart(splitPath(id).name))\n\n// Where a value is in what a node gives, a status by its pin's own `#status`\nconst pathPart = (path: readonly string[]) => path.map((field) => (field === statusKey ? statusKey : keyPart(field)))\n\n/**\n * The key a node's position is kept under: a state's name; the trigger's key; a Break's the value it takes apart, such\n * as `Save.record`, or `Save.#break` for the whole of what a step gives; a Make's the argument it builds, such as\n * `Save.#make.data`; a Select's the argument it chooses, such as `Notify.#select.to`; and a condition node's its place among its step's Condition's nodes, such as `Tell.#when` for the\n * one wired to Only when and `Tell.#when.1` for the one at its second side. Every key but the trigger's starts with its\n * state's name, so a save drops those of a state removed.\n */\nexport const layoutKey = (id: string, pure?: PureNode) => {\n if (pure?.kind === 'break') return [nameOf(pure.source), ...(pure.path.length === 0 ? ['#break'] : pathPart(pure.path))].join('.')\n if (pure?.kind === 'make') return [nameOf(pure.target), '#make', keyPart(pure.key)].join('.')\n if (pure?.kind === 'select') return [nameOf(pure.target), '#select', keyPart(pure.key)].join('.')\n if (pure?.kind === 'condition') return [nameOf(pure.target), '#when', ...pure.at.map(String)].join('.')\n return nameOf(id)\n}\n\n/** The layout without a node's position, which ELK then lays out again. */\nexport const withoutKey = (layout: ManualLayout, key: string): ManualLayout => Object.fromEntries(Object.entries(layout).filter(([other]) => other !== key))\n\n// As ELK spaces nodes, and pads a Map or Block on its right and below\nconst spacing = 32\nconst padding = { right: 24, bottom: 24 }\n\nconst overlaps = (a: Box, b: Box) => a.x < b.x + b.width && b.x < a.x + a.width && a.y < b.y + b.height && b.y < a.y + a.height\n\n/**\n * The boxes ELK laid out, with the nodes moved by hand at their places: within each Map or Block, and on the canvas, a\n * node ELK laid out over one that was moved, or over a Map grown around it, goes down below it, and a Map or Block grows\n * around what was moved inside it. Without a node moved, ELK's boxes as they are.\n */\nexport const placedBoxes = (laidOut: ReadonlyMap<string, Box>, moved: ReadonlyMap<string, Point>, parentOf: (id: string) => string | undefined): ReadonlyMap<string, Box> => {\n if (![...moved.keys()].some((id) => laidOut.has(id))) return laidOut\n const boxes = new Map([...laidOut].map(([id, box]) => [id, { ...box, ...moved.get(id) }]))\n const children = new Map<string | undefined, string[]>()\n for (const id of boxes.keys()) children.set(parentOf(id), [...(children.get(parentOf(id)) ?? []), id])\n const depth = (parent: string | undefined): number => (parent === undefined ? 0 : depth(parentOf(parent)) + 1)\n const grown = new Set<string>()\n // The innermost first, so a Map grown inside another is placed at its new size\n for (const parent of [...children.keys()].sort((a, b) => depth(b) - depth(a))) {\n const ids = children.get(parent)!\n if (ids.some((id) => moved.has(id) || grown.has(id))) {\n const placed = ids.filter((id) => moved.has(id)).map((id) => boxes.get(id)!)\n const others = ids.filter((id) => !moved.has(id)).map((id) => boxes.get(id)!).sort((a, b) => a.y - b.y || a.x - b.x)\n for (const box of others) {\n let under = placed.find((other) => overlaps(box, other))\n while (under) {\n box.y = under.y + under.height + spacing\n under = placed.find((other) => overlaps(box, other))\n }\n placed.push(box)\n }\n }\n const group = parent === undefined ? undefined : boxes.get(parent)\n if (!group) continue\n const width = Math.max(group.width, ...ids.map((id) => boxes.get(id)!).map((box) => box.x + box.width + padding.right))\n const height = Math.max(group.height, ...ids.map((id) => boxes.get(id)!).map((box) => box.y + box.height + padding.bottom))\n if (width === group.width && height === group.height) continue\n Object.assign(group, { width, height })\n grown.add(parent!)\n }\n return boxes\n}\n","import { messages } from '../../../locale/messages'\n\nexport const text = messages('app/field-types/workflow')\n","import { Check, Minus } from 'lucide-react'\nimport { cn } from '../lib/cn'\n\nexport type CheckboxProps = { checked: boolean; indeterminate?: boolean; onChange?: (checked: boolean) => void; label?: string; disabled?: boolean; className?: string }\n\nexport const Checkbox = ({ checked, indeterminate, onChange, label, disabled, className }: CheckboxProps) => (\n <button\n type=\"button\"\n role=\"checkbox\"\n aria-checked={indeterminate ? 'mixed' : checked}\n aria-label={label}\n disabled={disabled}\n onClick={() => onChange?.(!checked)}\n className={cn(\n 'relative inline-flex size-4 shrink-0 items-center justify-center rounded border transition-colors after:absolute after:-inset-1 after:content-[\"\"] pointer-coarse:after:-inset-3.5',\n checked || indeterminate ? 'border-primary bg-primary text-primary-foreground' : 'border-border-strong bg-background hover:border-faint-foreground',\n className,\n )}\n >\n {indeterminate ? <Minus className=\"size-3\" strokeWidth={3} /> : checked && <Check className=\"size-3\" strokeWidth={3} />}\n </button>\n)\n"],"ignoreList":[0,1,2,3,4],"mappings":"mwBASA,IAAMA,EAAa,CACjB,KAAM,QACN,KAAM,GACN,KAAM,CAAC,CAAC,OAAQ,CAAE,EAAG,kBAAmB,IAAK,QAAS,CAAC,CAAC,CAC1D,EACAA,EAAW,KACX,IAAM2B,EAAQb,EAAiBd,CAAU,ECNnCC,EAAa,CACjB,KAAM,eACN,KAAM,GACN,KAAM,CACJ,CAAC,SAAU,CAAE,GAAI,KAAM,GAAI,KAAM,EAAG,KAAM,IAAK,QAAS,CAAC,EACzD,CAAC,OAAQ,CAAE,GAAI,KAAM,GAAI,KAAM,GAAI,IAAK,GAAI,KAAM,IAAK,QAAS,CAAC,EACjE,CAAC,OAAQ,CAAE,GAAI,KAAM,GAAI,QAAS,GAAI,KAAM,GAAI,KAAM,IAAK,QAAS,CAAC,CACvE,EACA,QAAS,CAAC,cAAc,CAC1B,EACAA,EAAW,KACX,IAAM4B,EAAcf,EAAiBb,CAAU,ECXzCC,EAAa,CACjB,KAAM,cACN,KAAM,GACN,KAAM,CACJ,CAAC,OAAQ,CAAE,MAAO,IAAK,OAAQ,IAAK,EAAG,IAAK,EAAG,IAAK,GAAI,IAAK,IAAK,QAAS,CAAC,EAC5E,CAAC,OAAQ,CAAE,MAAO,IAAK,OAAQ,IAAK,EAAG,KAAM,EAAG,IAAK,GAAI,IAAK,IAAK,QAAS,CAAC,EAC7E,CAAC,OAAQ,CAAE,MAAO,IAAK,OAAQ,IAAK,EAAG,KAAM,EAAG,KAAM,GAAI,IAAK,IAAK,QAAS,CAAC,EAC9E,CAAC,OAAQ,CAAE,MAAO,IAAK,OAAQ,IAAK,EAAG,IAAK,EAAG,KAAM,GAAI,IAAK,IAAK,QAAS,CAAC,CAC/E,CACF,EACAA,EAAW,KACX,IAAM6B,GAAajB,EAAiB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U,SAAS,YAAa,CAAI,CAAA,CAChH,CAAA","debugId":"8e38e949-3c69-413f-9f72-2ceee754b768"}
@@ -1 +1 @@
1
- {"version":3,"file":"display-value-DoqvOXh1.js","names":["text","text","text","text","text","units","message","n","a","t","__toESM","formatTag","createLucideIcon","cn","cachedFormat","name","segments","pathSource","wholePath","placeholder","parseTemplatePath","text","variable","names","rest","up","templatePlaceholders","match","fillPlaceholders","value","path","wholePlaceholder","recordValueAt","parsed","key","record","resourceField","to","filterField","templated","resource","part","addressPlaceholders","textPlaceholders","hrefPlaceholders","fillText","valueText","fill","lookup","filterPlaceholder","comparedValue","afterComparison","fillFilter","filter","quote","quoted","bare","at","fillAddressFrom","fillAddress","bareFilterFields","quotedLiteral","wholeQuoted","embeddedFilterFields","literal","leavesApp","href","appHrefError","hrefField","hostPlaceholder","linkActionError","run","label","enumLabel","labels","__iconData","ChevronRight","import_jsx_runtime","require_jsx_runtime","Skeleton","skeletonMotion","className","revealLate","text$3","messages","inApp","event","Breadcrumb","parts","last","index","content","loading","current","above","onNavigate","RouteLink","newTab","onClick","onFollow","text$2","isLayoutNode","text$1","viewerZone","partsFormats","partsFormat","known","zone","format","wallClock","ms","zoneOffset","clock","pad","dayIn","instantAt","wall","startOfDayIn","day","zoneLabel","tag","dateFormat","options","dayShort","month","monthName","weekday","weekdayDate","formatDate","formatDayShort","zonedFormats","formatDateTime","formats","formatMonth","formatMonthName","formatMonthRange","from","formatWeekday","formatWeekdayDate","formatDayRange","formatTime","formatAgo","seconds","relative","units$1","formatRelativeTime","away","unit","size","isStoredFile","isFileDraft","fileShown","units","formatSize","bytes","isPreviewable","type","density","unbounded","covers","variant","box","area","shownImage","file","b","acceptOf","accept","field","filePatchValue","draft","fileDiffers","uri","stored","keyPart","model","recordId","recordKey","affixed","hints","displayValue","now","valueTitle"],"sources":["../../../../schema/src/template-path.ts","../../../../schema/src/address-template.ts","../../../../schema/src/enum-label.ts","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs","../../../src/primitives/skeleton.tsx","../../../src/app-shell/messages.ts","../../../src/app-shell/breadcrumb.tsx","../../../src/primitives/route-link.tsx","../../../src/app/messages.ts","../../../../layout/src/node.ts","../../../src/format/messages.ts","../../../src/format/zone.ts","../../../src/format/date.ts","../../../src/live/messages.ts","../../../src/live/file-values.ts","../../../src/live/model-helpers.ts","../../../src/live/display-value.ts"],"sourcesContent":["// Handlebars path expressions, the subset a placeholder `{{path}}` and a layout's `source` take: no helpers,\n// subexpressions, literals or `@key`. https://handlebarsjs.com/guide/expressions.html#path-expressions\n\nconst name = '[A-Za-z_][A-Za-z0-9_]*'\nconst segments = `${name}(?:\\\\.${name})*`\nconst pathSource = `@(?:root|params)(?:\\\\.${segments})?|@index|@first|@last|(?:\\\\.\\\\./)*(?:this(?:\\\\.${segments})?|\\\\./${segments}|${segments})`\n\nconst wholePath = new RegExp(`^(?:${pathSource})$`)\n\n/** A `{{…}}` with anything inside but braces, so a placeholder that is no path is found and refused, not left as text. */\nconst placeholder = /\\{\\{\\s*([^{}]*?)\\s*\\}\\}/g\n\n/** A data variable the renderer supplies (`@root`, `@params`, `@index`, `@first`, `@last`), or a name in the context stack. */\nexport type TemplatePath =\n | { kind: 'data'; variable: 'root' | 'params' | 'index' | 'first' | 'last'; names: string[] }\n /**\n * `up` is how many `../` lead it; `explicit` is true for `this`, `./` and any `../`, which read one context only, where\n * a bare name searches the stack. `names` is empty for `this` alone.\n */\n | { kind: 'context'; up: number; explicit: boolean; names: string[] }\n\n/** The path `text` is, or `undefined` when it is none, such as `a b`, `@key` or `../@root`. */\nexport const parseTemplatePath = (text: string): TemplatePath | undefined => {\n if (!wholePath.test(text)) return\n if (text.startsWith('@')) {\n const [variable, ...names] = text.slice(1).split('.')\n return { kind: 'data', variable: variable as 'root' | 'params' | 'index' | 'first' | 'last', names }\n }\n let rest = text\n let up = 0\n while (rest.startsWith('../')) {\n rest = rest.slice(3)\n up += 1\n }\n if (rest === 'this') return { kind: 'context', up, explicit: true, names: [] }\n if (rest.startsWith('this.')) return { kind: 'context', up, explicit: true, names: rest.slice(5).split('.') }\n if (rest.startsWith('./')) return { kind: 'context', up, explicit: true, names: rest.slice(2).split('.') }\n return { kind: 'context', up, explicit: up > 0, names: rest.split('.') }\n}\n\n/** Each `{{…}}` in `text`, as written between the braces, in order and repeated as often as it is. */\nexport const templatePlaceholders = (text: string) => [...text.matchAll(placeholder)].map((match) => match[1]!)\n\n/** `text` with every `{{path}}` replaced by `value(path)`; a placeholder that is no path is replaced too, by what `value` gives it. */\nexport const fillPlaceholders = (text: string, value: (path: string) => string) => text.replace(placeholder, (_, path: string) => value(path))\n\n/** A placeholder holding only a path, such as `{{website}}`: the path, or `undefined` when `text` is more than that. */\nexport const wholePlaceholder = (text: string) => {\n const match = /^\\{\\{\\s*([^{}]*?)\\s*\\}\\}$/.exec(text)\n return match && parseTemplatePath(match[1]!) ? match[1] : undefined\n}\n\n/**\n * The value at `path` in one record, as Mustache reads a single context: the first name from the record, the rest from\n * that value only. Anything that needs another context (`../`, `@root`) has none here, so it is `undefined`.\n */\nexport const recordValueAt = (record: Record<string, unknown>, path: string): unknown => {\n const parsed = parseTemplatePath(path)\n if (!parsed || parsed.kind !== 'context' || parsed.up > 0) return\n return parsed.names.reduce<unknown>((value, key) => (typeof value === 'object' && value !== null && Object.hasOwn(value, key) ? (value as Record<string, unknown>)[key] : undefined), record)\n}\n","import type { AppAddress } from './model'\nimport { fillPlaceholders, recordValueAt, templatePlaceholders, wholePlaceholder } from './template-path'\n\n/** How a filler reads the value at a path, such as `recordValueAt` on one record, or a layout's stack of records. */\nexport type PathLookup = (path: string) => unknown\n\nconst names = templatePlaceholders\n\n/** The path a link's address takes its resource from, when its `resource` is only `{{path}}`, as `'{{name}}'`. */\nexport const resourceField = (to: AppAddress) => (to.kind === 'page' ? undefined : wholePlaceholder(to.resource))\n\n/** The path a list address takes its whole filter from, when its `filter` is only `{{path}}`, as `'{{lever_filter}}'`: the record holds the filter's text. */\nexport const filterField = (to: AppAddress) => (to.kind === 'list' && to.filter !== undefined ? wholePlaceholder(to.filter) : undefined)\n\n// The parts of an address a `{{path}}` may stand in: a page's tab and parameters, the resource, the record key, tab, run and panel, the list's filter and order, a create form's values.\nconst templated = (to: AppAddress): string[] => {\n if (to.kind === 'page') return [...(to.tab === undefined ? [] : [to.tab]), ...Object.values(to.params ?? {})]\n const resource = resourceField(to) === undefined ? [] : [to.resource]\n if (to.kind === 'record') return [...resource, ...(Array.isArray(to.key) ? to.key : [to.key]).filter((part): part is string => typeof part === 'string'), ...[to.tab, to.run, to.panel].filter((part) => part !== undefined)]\n if (to.kind === 'list') return [...resource, ...[to.filter, to.orderBy].filter((part): part is string => part !== undefined)]\n return [...resource, ...Object.values(to.values ?? {})]\n}\n\n/** The paths whose values a link's address takes from the record, from its `{{path}}` placeholders. */\nexport const addressPlaceholders = (to: AppAddress) => [...new Set(templated(to).flatMap(names))]\n\n/** The paths a text, such as an href or a label, takes from the record, from its `{{path}}` placeholders. */\nexport const textPlaceholders = (text: string) => [...new Set(names(text))]\n\n/** The paths an href takes from the record, from its `{{path}}` placeholders. */\nexport const hrefPlaceholders = textPlaceholders\n\n/** `text` with every `{{path}}` replaced by `value(path)`, such as a button's label by the row's values as shown. */\nexport const fillText = fillPlaceholders\n\n/** A value as a placeholder writes it: a missing one empty. */\nexport const valueText = (value: unknown) => (value === null || value === undefined ? '' : String(value))\n\nconst fill = (text: string, lookup: PathLookup) => fillText(text, (path) => valueText(lookup(path)))\n\nconst filterPlaceholder = /([\"'])\\{\\{\\s*([^{}]*?)\\s*\\}\\}\\1|\\{\\{\\s*([^{}]*?)\\s*\\}\\}/g\n\n// A bare placeholder that is a comparison's value, as a typed layout writes `f.title.eq(data.title)`, or a function's\n// argument after the first, as in `in(title, {{title}})`: one bare word, such\n// as a number, a key or true, as it is; text that would break into more, such as a name with a space, quoted, so it\n// stays one value. Any other bare placeholder, a whole filter or a duration, goes in as it is.\nconst comparedValue = (value: unknown) => (typeof value === 'string' && value !== '' && !/^[\\w.:+-]+$/.test(value) ? JSON.stringify(value) : valueText(value))\n\nconst afterComparison = /(?:[=<>:,]|!=)\\s*$/\n\n/**\n * `filter` with every `{{path}}` replaced by its value. A quoted `'{{path}}'` takes the value as a string, its\n * backslashes and quotes escaped, so any text stays one value; Handlebars escapes for HTML instead, where this lands in\n * a filter or condition. A bare `{{path}}` that is a comparison's value, as a typed layout writes `f.title.eq(data.title)`,\n * takes one bare word as it is, such as a number or a key, and text with spaces or quotes quoted; any other bare one,\n * such as a whole filter or a duration, goes in as it is.\n */\nexport const fillFilter = (filter: string, lookup: PathLookup) =>\n filter.replace(filterPlaceholder, (_, quote: string | undefined, quoted: string | undefined, bare: string | undefined, at: number) => {\n if (quote) return `${quote}${valueText(lookup(quoted!)).replace(/\\\\/g, '\\\\\\\\').replaceAll(quote, `\\\\${quote}`)}${quote}`\n const value = lookup(bare!)\n return afterComparison.test(filter.slice(0, at)) ? comparedValue(value) : valueText(value)\n })\n\n/**\n * `to` with every `{{path}}` in its page parameters, resource, key, tab, run, panel, filter, order or values replaced by the value\n * `lookup` gives; a missing value becomes empty, and one quoted in a filter is escaped.\n */\nexport const fillAddressFrom = (to: AppAddress, lookup: PathLookup): AppAddress => {\n if (to.kind === 'page') return { ...to, ...(to.tab !== undefined && { tab: fill(to.tab, lookup) }), ...(to.params && { params: Object.fromEntries(Object.entries(to.params).map(([name, value]) => [name, fill(value, lookup)])) }) }\n const resource = resourceField(to) === undefined ? to.resource : fill(to.resource, lookup)\n if (to.kind === 'record') {\n const part = (value: string | number) => (typeof value === 'string' ? fill(value, lookup) : value)\n return { ...to, resource, key: Array.isArray(to.key) ? to.key.map(part) : part(to.key as string | number), ...(to.tab !== undefined && { tab: fill(to.tab, lookup) }), ...(to.run !== undefined && { run: fill(to.run, lookup) }), ...(to.panel !== undefined && { panel: fill(to.panel, lookup) }) }\n }\n if (to.kind === 'create') return { ...to, resource, ...(to.values && { values: Object.fromEntries(Object.entries(to.values).map(([name, value]) => [name, fill(value, lookup)])) }) }\n return { ...to, resource, ...(to.filter !== undefined && { filter: fillFilter(to.filter, lookup) }), ...(to.orderBy !== undefined && { orderBy: fill(to.orderBy, lookup) }) }\n}\n\n/** `to` with every `{{path}}` replaced by the record's value at that path. */\nexport const fillAddress = (to: AppAddress, record: Record<string, unknown> = {}): AppAddress => fillAddressFrom(to, (path) => recordValueAt(record, path))\n\n/** The paths a list address's filter takes outside quotes, whose values go into the filter as they are, such as `{{task_id}}` in `task_id = {{task_id}}`. */\nexport const bareFilterFields = (to: AppAddress) =>\n to.kind === 'list' && to.filter !== undefined ? [...new Set([...to.filter.matchAll(filterPlaceholder)].flatMap((match) => (match[3] === undefined ? [] : [match[3]])))] : []\n\nconst quotedLiteral = /([\"'])(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])*\\1/g\n\nconst wholeQuoted = /^([\"'])\\{\\{\\s*[^{}]*?\\s*\\}\\}\\1$/\n\n/**\n * The paths a filter takes inside a longer quoted value, such as `{{name}}` in `title = 'abc{{name}}'`; only a quoted\n * value that is the placeholder alone is escaped when filled, so these are refused.\n */\nexport const embeddedFilterFields = (filter: string) => [...new Set([...filter.matchAll(quotedLiteral)].flatMap(([literal]) => (wholeQuoted.test(literal) ? [] : names(literal))))]\n\n/**\n * Whether an href leaves the app: it starts with a scheme (`https:`, `mailto:`) or `//`. A path inside the app is an\n * address, given as `to`, so that it is written one way everywhere.\n */\nexport const leavesApp = (href: string) => /^([a-z][a-z0-9+.-]*:|\\/\\/)/i.test(href)\n\n/** Why an href cannot be a link's `href`: it points inside the app, which takes an address in `to`. */\nexport const appHrefError = (href: string) =>\n leavesApp(href) ? undefined : `href \"${href}\" points inside the app; give the link \\`to\\` instead, an address such as { kind: 'record', resource: 'orders', key: '{{order_id}}' }`\n\n/** The path an action's href is made of alone, `{{field}}`: the record's value is the whole URL, as it is stored. */\nexport const hrefField = wholePlaceholder\n\n/** What a link action's label writes for the host its target opens. */\nexport const hostPlaceholder = '{{host}}'\n\n/**\n * Why a link action cannot be built: an `href` that points inside the app (one that is a single `{{field}}`, the URL the\n * record holds, is fine), or `{{host}}` in the label of a link that goes `to` an address in the app, which has no host.\n */\nexport const linkActionError = (label: string, run: { to: AppAddress } | { href: string }) => {\n if ('href' in run) return hrefField(run.href) ? undefined : appHrefError(run.href)\n return label.includes(hostPlaceholder) ? `the label names ${hostPlaceholder}, which only a link with an href has` : undefined\n}\n","/** How an enum value reads: its label from the view's `valueLabels`, else the stored value unchanged (`co_signer`). */\nexport const enumLabel = (value: string, labels?: Record<string, string>) => labels?.[value] ?? value\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"chevron-right\",\n size: 24,\n node: [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]]\n};\n__iconData.node;\nconst ChevronRight = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronRight as default };\n//# sourceMappingURL=chevron-right.mjs.map\n","import type { CSSProperties } from 'react'\nimport { cn } from '../lib/cn'\n\n/**\n * A placeholder shaped like what is loading, which keeps that content's room. It stays blank for its first 180 ms, so a\n * load that quick shows no flash, then shimmers, or stays still when less motion is asked for.\n */\nexport const Skeleton = ({ className, style }: { className?: string; style?: CSSProperties }) => (\n <span className={cn('block h-3 rounded bg-muted', skeletonMotion, className)} style={style} />\n)\n\n/** Blank for the first 180 ms, for a loading notice such as a spinner, so a quick load never flashes it. */\nexport const revealLate = '[animation:pb-reveal_1ms_180ms_backwards]'\n\nconst skeletonMotion = '[animation:pb-reveal_1ms_180ms_backwards,pb-shimmer_1.4s_180ms_ease-in-out_infinite] motion-reduce:[animation:pb-reveal_1ms_180ms_backwards]'\n","import { messages } from '../locale/messages'\n\nexport const text = messages('app-shell')\n","import { ChevronRight } from 'lucide-react'\nimport type { MouseEvent } from 'react'\nimport { cn } from '../lib/cn'\nimport { Skeleton } from '../primitives/skeleton'\nimport { text } from './messages'\n\n/**\n * One step of the top bar's trail: plain text, or a link when it has a page of its own. A loading crumb shows a skeleton,\n * with its label for screen readers. A last crumb marked `above` is the page the shown one sits under, as a list is\n * above its record: it is not the current page, and on a phone the back button, which goes to it, shows its label.\n */\nexport type Crumb = string | { label: string; href?: string; loading?: boolean; above?: boolean }\n\nexport type BreadcrumbProps = {\n parts: Crumb[]\n /** Follows a crumb's link in the app; modified and middle clicks are left to the browser, so they open a new tab. */\n onNavigate?: (href: string) => void\n}\n\n/** A plain left click, which the app follows itself; others open a new tab. */\nexport const inApp = (event: MouseEvent) => event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey\n\n/** The trail of where you are; the current page, the last crumb unless it is `above`, shows on phones too. */\nexport const Breadcrumb = ({ parts, onNavigate }: BreadcrumbProps) => (\n <nav aria-label={text('breadcrumb')} className=\"flex min-w-0 items-center gap-1.5\">\n {parts.map((part, index) => {\n const last = index === parts.length - 1\n const { label, href, loading, above } = typeof part === 'string' ? { label: part, href: undefined, loading: false, above: false } : part\n const content = loading ? <Skeleton className=\"w-24\" /> : label\n const current = last && !above\n const text = cn('truncate', current ? 'font-semibold' : 'text-muted-foreground')\n return (\n <span key={`${index}-${label}`} className={cn('min-w-0 items-center gap-1.5', current ? 'flex' : 'hidden md:flex')}>\n {index > 0 && <ChevronRight className=\"hidden size-3.5 shrink-0 text-faint-foreground md:block\" />}\n {href ? (\n <a\n href={href}\n aria-current={current ? 'page' : undefined}\n aria-label={loading ? label : undefined}\n aria-busy={loading || undefined}\n onClick={(event) => {\n if (!onNavigate || !inApp(event)) return\n event.preventDefault()\n onNavigate(href)\n }}\n className={cn(text, 'rounded-sm hover:text-foreground hover:underline')}\n >\n {content}\n </a>\n ) : (\n <span className={text} aria-label={loading ? label : undefined} aria-busy={loading || undefined}>\n {content}\n </span>\n )}\n </span>\n )\n })}\n </nav>\n)\n","import type { AnchorHTMLAttributes } from 'react'\nimport { inApp } from '../app-shell/breadcrumb'\n\n/**\n * Where a link goes: the `href` the browser shows and opens, and how the app follows it in place. One without\n * `onFollow`, a page outside the app, the browser follows itself, in a new tab without the app's window or address\n * with `newTab`.\n */\nexport type RouteTarget = { href: string; onFollow?: () => void; newTab?: boolean }\n\n/**\n * An ordinary anchor to `to.href`: a plain click follows it in place with `to.onFollow`, while a middle click or one\n * with Ctrl, Cmd, Shift or Alt opens it in a new tab or window, or saves it, as on any link. Every navigation a click\n * starts is one of these, never a button that moves the page, so the browser shows where it goes and can open it.\n */\nexport const RouteLink = ({ to, onClick, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement> & { to: RouteTarget }) => {\n const { href, onFollow, newTab } = to\n return (\n <a\n href={href}\n {...(newTab && { target: '_blank', rel: 'noreferrer' })}\n onClick={(event) => {\n onClick?.(event)\n if (!onFollow || event.defaultPrevented || !inApp(event)) return\n event.preventDefault()\n onFollow()\n }}\n {...rest}\n />\n )\n}\n","import { messages } from '../locale/messages'\n\n// Texts the app's pages share: the notices of an address that leads nowhere, and an error without words of its own\nexport const text = messages('app')\n","/** A static value a layout prop may hold: what survives `JSON.stringify` unchanged, plus elements (also plain data). */\nexport type LayoutValue = string | number | boolean | null | LayoutValue[] | { [key: string]: LayoutValue }\n\n/**\n * Which props of a block that reads records name what it reads: the resource, its filter, its sort, the fields it\n * draws and how many records it reads, so a page's reads can be planned from the tree. A block without one reads\n * nothing of its own. `fields` is a prop, or several, each holding a field name or a list of them. `select` is the\n * prop naming the page parameter that holds the key of the record chosen among them, inside which its children draw.\n */\nexport type BlockReads = { resource: string; filter?: string; sort?: string; fields?: string | string[]; limit?: string; select?: string }\n\n/**\n * What a custom component reads: one read, or several, each named by the prop of its resource (`nodes`, `edges`), as\n * the page's plan names them.\n */\nexport type ComponentReads = BlockReads | BlockReads[]\n\n/** One element of a layout tree. Plain data: it is sent to the browser as JSON and rendered there. */\nexport type LayoutNode = {\n /** A built-in block (`Table`) or a custom component's registered name. */\n type: string\n props: Record<string, LayoutValue>\n children: LayoutChild[]\n /** Set on custom components, which the app renders with the React component registered under `type`. */\n custom?: true\n /**\n * What a client draws in place of a custom component it does not have, or that fails to draw: elements and text,\n * or none to draw nothing. Absent when the component declares no fallback.\n */\n fallback?: LayoutChild[]\n /** Which of a custom component's props name what it reads, as its `component()` declares, so the page's plan reads it. */\n reads?: ComponentReads\n}\n\nexport type LayoutChild = LayoutNode | string\n\n/** What JSX accepts as children; `null`, `undefined` and booleans render nothing, like in React. */\nexport type LayoutChildren = LayoutChild | number | boolean | null | undefined | LayoutChildren[]\n\n/** A block as JSX sees it: called by the runtime with its props, it describes one element. */\nexport type Block<P> = ((props: P) => LayoutNode) & { readonly blockName: string; readonly custom: boolean; readonly fallback?: LayoutChild[]; readonly reads?: ComponentReads }\n\nexport const isLayoutNode = (value: unknown): value is LayoutNode =>\n typeof value === 'object' && value !== null && !Array.isArray(value) && typeof (value as LayoutNode).type === 'string' && Array.isArray((value as LayoutNode).children)\n\n/** An element's props without the elements it holds (`actions={...}`), which are walked as elements of their own. */\nexport const dataProps = (node: LayoutNode) =>\n Object.fromEntries(Object.entries(node.props).filter(([, value]) => !isLayoutNode(value) && !(Array.isArray(value) && value.length > 0 && value.every(isLayoutNode))))\n","import { messages } from '../locale/messages'\n\nexport const text = messages('format')\n","import { cachedFormat } from './intl-cache'\n\n// Times show in the viewer's time zone, the browser's; dates (`YYYY-MM-DD`, no time) have no zone and never shift.\n\n/** The viewer's IANA time zone, such as `Europe/Amsterdam`. */\nexport const viewerZone = () => Intl.DateTimeFormat().resolvedOptions().timeZone\n\nconst partsFormats = new Map<string, Intl.DateTimeFormat>()\n\nconst partsFormat = (zone: string) => {\n const known = partsFormats.get(zone)\n if (known) return known\n const format = new Intl.DateTimeFormat('en-US', { timeZone: zone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })\n partsFormats.set(zone, format)\n return format\n}\n\n// The wall clock of `zone` at `ms`, as numbers\nconst wallClock = (ms: number, zone: string) => {\n const parts = Object.fromEntries(partsFormat(zone).formatToParts(ms).map((part) => [part.type, part.value]))\n return { year: Number(parts.year), month: Number(parts.month), day: Number(parts.day), hour: Number(parts.hour), minute: Number(parts.minute), second: Number(parts.second) }\n}\n\n/** How far `zone`'s clock is ahead of UTC at `ms`, in milliseconds: 7 200 000 for Amsterdam in summer. */\nexport const zoneOffset = (ms: number, zone: string) => {\n const clock = wallClock(ms, zone)\n const asUtc = Date.UTC(clock.year, clock.month - 1, clock.day, clock.hour, clock.minute, clock.second)\n return asUtc - Math.floor(ms / 1000) * 1000\n}\n\nconst pad = (value: number) => String(value).padStart(2, '0')\n\n/** The day `ms` falls on in `zone`, as `YYYY-MM-DD`. */\nexport const dayIn = (ms: number, zone: string) => {\n const clock = wallClock(ms, zone)\n return `${clock.year}-${pad(clock.month)}-${pad(clock.day)}`\n}\n\n/** The instant `zone`'s clock reads `wall`, a wall-clock time written as if it were UTC milliseconds. */\nexport const instantAt = (wall: number, zone: string) => {\n // The offset at `wall` read as UTC is right unless the zone changes its clock in the hours between; a second pass fixes that\n const guess = wall - zoneOffset(wall, zone)\n return wall - zoneOffset(guess, zone)\n}\n\n/** The instant `day` (`YYYY-MM-DD`) starts in `zone`: its local midnight. */\nexport const startOfDayIn = (day: string, zone: string) => instantAt(Date.parse(`${day}T00:00:00Z`), zone)\n\n/** The zone a time is shown in, as its hover label says: \"Europe/Amsterdam (GMT+2)\", or \"UTC\". */\nexport const zoneLabel = (ms: number, zone: string) => {\n const named = cachedFormat(`zoneName:${zone}`, (tag) => new Intl.DateTimeFormat(tag, { timeZone: zone, timeZoneName: 'shortOffset' }))\n const name = named.formatToParts(ms).find((part) => part.type === 'timeZoneName')?.value ?? zone\n return zone === 'UTC' || zone === 'Etc/UTC' ? 'UTC' : `${zone} (${name})`\n}\n","import { cachedFormat } from './intl-cache'\nimport { text } from './messages'\nimport { viewerZone } from './zone'\n\n// Dates, months and weekdays are zone-free days, kept in UTC; times are the viewer's, in `zone`.\nconst dateFormat = (name: string, options: Intl.DateTimeFormatOptions) => () => cachedFormat(`date:${name}`, (tag) => new Intl.DateTimeFormat(tag, { ...options, timeZone: 'UTC' }))\nconst day = dateFormat('day', { day: 'numeric', month: 'short', year: 'numeric' })\nconst dayShort = dateFormat('dayShort', { day: 'numeric', month: 'short' })\nconst month = dateFormat('month', { month: 'long', year: 'numeric' })\nconst monthName = dateFormat('monthName', { month: 'long' })\nconst weekday = dateFormat('weekday', { weekday: 'short' })\nconst weekdayDate = dateFormat('weekdayDate', { weekday: 'long', day: 'numeric', month: 'short', year: 'numeric' })\n\nexport const formatDate = (ms: number) => day().format(ms)\n\nexport const formatDayShort = (ms: number) => dayShort().format(ms)\n\nconst zonedFormats = (zone: string) =>\n cachedFormat(`zoned:${zone}`, (tag) => ({\n day: new Intl.DateTimeFormat(tag, { day: 'numeric', month: 'short', year: 'numeric', timeZone: zone }),\n time: new Intl.DateTimeFormat(tag, { hour: '2-digit', minute: '2-digit', hour12: false, timeZone: zone }),\n }))\n\n/** \"6 Oct 2026, 16:32\": an instant on the clock of `zone`, the viewer's unless given. */\nexport const formatDateTime = (ms: number, zone = viewerZone()) => {\n const formats = zonedFormats(zone)\n return `${formats.day.format(ms)}, ${formats.time.format(ms)}`\n}\n\n/** \"October 2026\". */\nexport const formatMonth = (ms: number) => month().format(ms)\n\n/** \"October\". */\nexport const formatMonthName = (ms: number) => monthName().format(ms)\n\n/** \"October – December 2026\": the months from `from` to `to`, both included. */\nexport const formatMonthRange = (from: number, to: number) => month().formatRange(from, to)\n\n/** \"Mon\". */\nexport const formatWeekday = (ms: number) => weekday().format(ms)\n\n/** \"Monday, 12 Oct 2026\". */\nexport const formatWeekdayDate = (ms: number) => weekdayDate().format(ms)\n\n/** \"12–18 Oct 2026\", \"28 Dec 2026 – 3 Jan 2027\": the days from `from` to `to`, both included. */\nexport const formatDayRange = (from: number, to: number) => day().formatRange(from, to)\n\n/** \"09:30\": an instant's time on the clock of `zone`, the viewer's unless given. */\nexport const formatTime = (ms: number, zone = viewerZone()) => zonedFormats(zone).time.format(ms)\n\nexport const formatAgo = (seconds: number) => {\n if (seconds < 60) return text('secondsAgo', { count: seconds })\n if (seconds < 3600) return text('minutesAgo', { count: Math.floor(seconds / 60) })\n if (seconds < 86_400) return text('hoursAgo', { count: Math.floor(seconds / 3600) })\n return text('daysAgo', { count: Math.floor(seconds / 86_400) })\n}\n\nconst relative = () => cachedFormat('relative', (tag) => new Intl.RelativeTimeFormat(tag, { numeric: 'auto' }))\n\nconst units: Array<[Intl.RelativeTimeFormatUnit, number]> = [\n ['year', 31_536_000],\n ['month', 2_592_000],\n ['day', 86_400],\n ['hour', 3600],\n ['minute', 60],\n]\n\n/** \"5 minutes ago\", \"yesterday\", \"in 3 hours\"; `seconds` is how long ago it was, negative for a time to come. */\nexport const formatRelativeTime = (seconds: number) => {\n const away = Math.abs(seconds)\n const [unit, size] = units.find(([, size]) => away >= size) ?? ['second', 1]\n if (unit === 'second' && away < 45) return text('justNow')\n return relative().format(-Math.sign(seconds) * Math.floor(away / size), unit)\n}\n","import { messages } from '../locale/messages'\n\nexport const text = messages('live')\n","import type { StoredFile, UploadResult } from '@protobase/client'\nimport type { FieldModel } from '@protobase/schema'\nimport { text } from './messages'\n\n/** A file uploaded in the form and not yet saved: the ticket the save sends, and a local preview while there is one. */\nexport type FileDraft = { uploaded: UploadResult; preview?: string }\n\nexport const isStoredFile = (value: unknown): value is StoredFile =>\n typeof value === 'object' && value !== null && typeof (value as { uri?: unknown }).uri === 'string'\n\nexport const isFileDraft = (value: unknown): value is FileDraft =>\n typeof value === 'object' && value !== null && typeof (value as { uploaded?: { value?: unknown } }).uploaded?.value === 'string'\n\n/** What a file field shows: its name, type and size, whether stored or just uploaded; `undefined` when empty. */\nexport const fileShown = (value: unknown) => {\n if (isFileDraft(value)) return { ...value.uploaded.file, ...(value.preview && { url: value.preview }), corrected: value.uploaded.corrected }\n if (!isStoredFile(value)) return undefined\n if ('missing' in value) return { name: text('fileMissing'), type: '', missing: true as const }\n return value\n}\n\nconst units = ['bytes', 'kB', 'MB', 'GB']\n\n/** `48 kB`, `1.2 MB`: decimal units, like the field's `maxSize`. */\nexport const formatSize = (bytes: number) => {\n let size = bytes\n let unit = 0\n while (size >= 1000 && unit < units.length - 1) {\n size /= 1000\n unit += 1\n }\n return unit === 0 ? `${bytes} ${bytes === 1 ? 'byte' : 'bytes'}` : `${size < 10 ? size.toFixed(1) : Math.round(size)} ${units[unit]}`\n}\n\n/** Raster images the browser shows; SVG is never shown, since it can carry scripts. */\nexport const isPreviewable = (type: string) => type.startsWith('image/') && type !== 'image/svg+xml'\n\n/** Where a picture is drawn, in CSS pixels. */\nexport type ImageBox = { width: number; height: number }\n\n// An image for a box needs this many pixels per CSS pixel to stay sharp on a high-density screen.\nconst density = 2\n// A side a variant leaves unbounded counts as larger than any image.\nconst unbounded = 100_000\n\ntype Variant = { url: string; width?: number; height?: number }\n\nconst covers = (variant: Variant, box: ImageBox) =>\n (variant.width !== undefined || variant.height !== undefined) &&\n (variant.width ?? unbounded) >= box.width * density &&\n (variant.height ?? unbounded) >= box.height * density\n\nconst area = (variant: Variant) => (variant.width ?? unbounded) * (variant.height ?? unbounded)\n\n/**\n * The picture of a file for `box`: the link of its smallest variant large enough for it, else the file's own, with its\n * placeholder; `undefined` for a file that is no raster image with a link.\n */\nexport const shownImage = (value: unknown, box: ImageBox) => {\n const file = fileShown(value)\n if (!file || 'missing' in file || !file.url || !isPreviewable(file.type)) return undefined\n const variants: Variant[] = 'variants' in file && file.variants ? Object.values(file.variants) : []\n const best = variants.filter((variant) => covers(variant, box)).sort((a, b) => area(a) - area(b))[0]\n return { url: best?.url ?? file.url, ...('placeholder' in file && file.placeholder !== undefined && { placeholder: file.placeholder }) }\n}\n\n/** The file input's `accept`: the field's allowed types, or nothing when it takes any. */\nexport const acceptOf = (field: FieldModel) => {\n const accept = field.file?.accept ?? []\n return accept.length === 0 || accept.includes('*/*') ? undefined : accept.join(',')\n}\n\n/** What a save sends for a file field: the ticket of a new upload, `null` to clear it, the stored URI to keep it. */\nexport const filePatchValue = (draft: unknown) => {\n if (isFileDraft(draft)) return draft.uploaded.value\n if (isStoredFile(draft)) return draft.uri\n return null\n}\n\n/** Whether a file field's draft changes what is stored. */\nexport const fileDiffers = (draft: unknown, stored: unknown) => {\n if (isFileDraft(draft)) return true\n const uri = (value: unknown) => (isStoredFile(value) ? value.uri : null)\n return uri(draft) !== uri(stored)\n}\n","import type { ResourceModel } from '@protobase/schema'\n\nexport { labelFieldOf, recordTitle, recordTitleField } from '@protobase/schema/internal'\n\n// A key part of a record; a list row holds a relation as `{ id, name }`, so a relation key part is its `id`.\nconst keyPart = (model: ResourceModel, record: Record<string, unknown>, name: string) => {\n const value = record[name]\n const labelled = model.fields[name]?.type === 'relation' && typeof value === 'object' && value !== null && 'id' in value\n return (labelled ? value.id : value) as string | number\n}\n\nexport const recordId = (model: ResourceModel, record: Record<string, unknown>) =>\n model.primaryKey.map((name) => String(keyPart(model, record, name))).join(',')\n\n/** The key as the URL carries it, for `get` and `update`, from a stored record or a list row. */\nexport const recordKey = (model: ResourceModel, record: Record<string, unknown>) => {\n const parts = model.primaryKey.map((name) => keyPart(model, record, name))\n return parts.length === 1 ? parts[0]! : parts\n}\n","import { enumLabel, type FieldModel, type FieldViewModel } from '@protobase/schema'\nimport { formatDate, formatDateTime, formatRelativeTime } from '../format/date'\nimport { viewerZone, zoneLabel } from '../format/zone'\nimport { fileShown } from './file-values'\nimport { formatTag } from '../locale/active-locale'\nimport { text as message } from './messages'\n\n// A number with the view's prefix before it and suffix after it, such as `€1,200` or `120 m²`.\nconst affixed = (text: string, hints: FieldViewModel) => `${hints.prefix ?? ''}${text}${hints.suffix ?? ''}`\n\n/**\n * A read-only rendering of a stored value, following the view's prefix, suffix, decimals, format and value label hints; a\n * timestamp on the clock of `zone`, the viewer's unless given.\n */\nexport const displayValue = (field: FieldModel, value: unknown, hints: FieldViewModel = {}, zone = viewerZone(), now = Date.now()) => {\n if (value === null || value === undefined || value === '') return '—'\n switch (field.type) {\n case 'boolean':\n return value ? message('yes') : message('no')\n case 'file':\n return fileShown(value)?.name ?? '—'\n case 'enum':\n return enumLabel(String(value), hints.valueLabels)\n case 'timestamp': {\n const ms = Date.parse(String(value))\n return hints.format === 'relative' ? formatRelativeTime(Math.round((now - ms) / 1000)) : formatDateTime(ms, zone)\n }\n case 'date':\n return formatDate(Date.parse(String(value)))\n case 'decimal': {\n const text = hints.decimals === undefined ? String(value) : Number(value).toFixed(hints.decimals)\n if (hints.format === 'percent') return `${Number(value)}%`\n return affixed(Number(text).toLocaleString(formatTag(), { minimumFractionDigits: hints.decimals ?? 0, maximumFractionDigits: hints.decimals ?? 20 }), hints)\n }\n case 'integer':\n case 'bigint':\n return affixed(String(value), hints)\n default:\n return typeof value === 'object' ? JSON.stringify(value) : String(value)\n }\n}\n\n/** The hover label of a shown value: the time zone a timestamp is shown in, or its exact time when shown relative; nothing for other values. */\nexport const valueTitle = (field: FieldModel, value: unknown, zone = viewerZone(), hints: FieldViewModel = {}) => {\n if (field.type !== 'timestamp' || typeof value !== 'string') return undefined\n const ms = Date.parse(value)\n if (Number.isNaN(ms)) return undefined\n if (hints.format === 'relative') return formatDateTime(ms, zone)\n return message('shownIn', { zone: zoneLabel(ms, zone) })\n}\n"],"ignoreList":[3],"mappings":"mrBAGA,IAAMe,EAAO,yBACPC,EAAW,GAAGD,EAAK,QAAQA,EAAK,IAChCE,EAAa,yBAAyBD,EAAS,kDAAkDA,EAAS,SAASA,EAAS,GAAGA,EAAS,GAExIE,EAAgB,OAAO,OAAOD,EAAW,GAAG,EAG5CE,EAAc,2BAYPC,EAAqB,GAA2C,CAC3E,GAAI,CAACF,EAAU,KAAKG,CAAI,EAAG,OAC3B,GAAIA,EAAK,WAAW,GAAG,EAAG,CACxB,GAAM,CAACC,EAAU,GAAGC,GAASF,EAAK,MAAM,CAAC,CAAC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K,CAAC,CAAC,EAC7C,IAAK,UAAW,CACd,IAAMR,EAAO8J,EAAM,WAAa,IAAA,GAAY,OAAOtJ,CAAK,EAAI,OAAOA,CAAK,CAAC,CAAC,QAAQsJ,EAAM,QAAQ,EAEhG,OADIA,EAAM,SAAW,UAAkB,GAAG,OAAOtJ,CAAK,EAAE,GACjDqJ,GAAQ,OAAO7J,CAAI,CAAC,CAAC,eAAeV,EAAU,EAAG,CAAE,sBAAuBwK,EAAM,UAAY,EAAG,sBAAuBA,EAAM,UAAY,EAAG,CAAC,EAAGA,CAAK,CAC7J,CACA,IAAK,UACL,IAAK,SACH,OAAOD,GAAQ,OAAOrJ,CAAK,EAAGsJ,CAAK,EACrC,QACE,OAAO,OAAOtJ,GAAU,SAAW,KAAK,UAAUA,CAAK,EAAI,OAAOA,CAAK,CAC3E,CACF,EAGayJ,IAAc,EAAmB,EAAgB,EAAO/E,EAAW,EAAG,EAAwB,CAAC,IAAM,CAChH,GAAIiE,EAAM,OAAS,aAAe,OAAO3I,GAAU,SAAU,OAC7D,IAAMiF,EAAK,KAAK,MAAMjF,CAAK,EAC3B,GAAI,QAAO,MAAMiF,CAAE,EAEnB,OADIqE,EAAM,SAAW,WAAmBhD,EAAerB,EAAIH,CAAI,EACxDrG,EAAQ,UAAW,CAAE,KAAMiH,EAAUT,EAAIH,CAAI,CAAE,CAAC,CACzD","debugId":"e8aaf397-8758-45f6-a74c-48532c95f6d4"}
1
+ {"version":3,"file":"display-value-fDiKbfJO.js","names":["text","text","text","text","text","units","message","n","a","t","__toESM","formatTag","createLucideIcon","cn","cachedFormat","name","segments","pathSource","wholePath","placeholder","parseTemplatePath","text","variable","names","rest","up","templatePlaceholders","match","fillPlaceholders","value","path","wholePlaceholder","recordValueAt","parsed","key","record","resourceField","to","filterField","templated","resource","part","addressPlaceholders","textPlaceholders","hrefPlaceholders","fillText","valueText","fill","lookup","filterPlaceholder","comparedValue","afterComparison","fillFilter","filter","quote","quoted","bare","at","fillAddressFrom","fillAddress","bareFilterFields","quotedLiteral","wholeQuoted","embeddedFilterFields","literal","leavesApp","href","appHrefError","hrefField","hostPlaceholder","linkActionError","run","label","enumLabel","labels","__iconData","ChevronRight","import_jsx_runtime","require_jsx_runtime","Skeleton","skeletonMotion","className","revealLate","text$3","messages","inApp","event","Breadcrumb","parts","last","index","content","loading","current","above","onNavigate","RouteLink","newTab","onClick","onFollow","text$2","isLayoutNode","text$1","viewerZone","partsFormats","partsFormat","known","zone","format","wallClock","ms","zoneOffset","clock","pad","dayIn","instantAt","wall","startOfDayIn","day","zoneLabel","tag","dateFormat","options","dayShort","month","monthName","weekday","weekdayDate","formatDate","formatDayShort","zonedFormats","formatDateTime","formats","formatMonth","formatMonthName","formatMonthRange","from","formatWeekday","formatWeekdayDate","formatDayRange","formatTime","formatAgo","seconds","relative","units$1","formatRelativeTime","away","unit","size","isStoredFile","isFileDraft","fileShown","units","formatSize","bytes","isPreviewable","type","density","unbounded","covers","variant","box","area","shownImage","file","b","acceptOf","accept","field","filePatchValue","draft","fileDiffers","uri","stored","keyPart","model","recordId","recordKey","affixed","hints","displayValue","now","valueTitle"],"sources":["../../../../schema/src/template-path.ts","../../../../schema/src/address-template.ts","../../../../schema/src/enum-label.ts","../../../../../node_modules/.bun/lucide-react@1.52.0+0ac650c021fb1b59/node_modules/lucide-react/dist/esm/icons/chevron-right.mjs","../../../src/primitives/skeleton.tsx","../../../src/app-shell/messages.ts","../../../src/app-shell/breadcrumb.tsx","../../../src/primitives/route-link.tsx","../../../src/app/messages.ts","../../../../layout/src/node.ts","../../../src/format/messages.ts","../../../src/format/zone.ts","../../../src/format/date.ts","../../../src/live/messages.ts","../../../src/live/file-values.ts","../../../src/live/model-helpers.ts","../../../src/live/display-value.ts"],"sourcesContent":["// Handlebars path expressions, the subset a placeholder `{{path}}` and a layout's `source` take: no helpers,\n// subexpressions, literals or `@key`. https://handlebarsjs.com/guide/expressions.html#path-expressions\n\nconst name = '[A-Za-z_][A-Za-z0-9_]*'\nconst segments = `${name}(?:\\\\.${name})*`\nconst pathSource = `@(?:root|params)(?:\\\\.${segments})?|@index|@first|@last|(?:\\\\.\\\\./)*(?:this(?:\\\\.${segments})?|\\\\./${segments}|${segments})`\n\nconst wholePath = new RegExp(`^(?:${pathSource})$`)\n\n/** A `{{…}}` with anything inside but braces, so a placeholder that is no path is found and refused, not left as text. */\nconst placeholder = /\\{\\{\\s*([^{}]*?)\\s*\\}\\}/g\n\n/** A data variable the renderer supplies (`@root`, `@params`, `@index`, `@first`, `@last`), or a name in the context stack. */\nexport type TemplatePath =\n | { kind: 'data'; variable: 'root' | 'params' | 'index' | 'first' | 'last'; names: string[] }\n /**\n * `up` is how many `../` lead it; `explicit` is true for `this`, `./` and any `../`, which read one context only, where\n * a bare name searches the stack. `names` is empty for `this` alone.\n */\n | { kind: 'context'; up: number; explicit: boolean; names: string[] }\n\n/** The path `text` is, or `undefined` when it is none, such as `a b`, `@key` or `../@root`. */\nexport const parseTemplatePath = (text: string): TemplatePath | undefined => {\n if (!wholePath.test(text)) return\n if (text.startsWith('@')) {\n const [variable, ...names] = text.slice(1).split('.')\n return { kind: 'data', variable: variable as 'root' | 'params' | 'index' | 'first' | 'last', names }\n }\n let rest = text\n let up = 0\n while (rest.startsWith('../')) {\n rest = rest.slice(3)\n up += 1\n }\n if (rest === 'this') return { kind: 'context', up, explicit: true, names: [] }\n if (rest.startsWith('this.')) return { kind: 'context', up, explicit: true, names: rest.slice(5).split('.') }\n if (rest.startsWith('./')) return { kind: 'context', up, explicit: true, names: rest.slice(2).split('.') }\n return { kind: 'context', up, explicit: up > 0, names: rest.split('.') }\n}\n\n/** Each `{{…}}` in `text`, as written between the braces, in order and repeated as often as it is. */\nexport const templatePlaceholders = (text: string) => [...text.matchAll(placeholder)].map((match) => match[1]!)\n\n/** `text` with every `{{path}}` replaced by `value(path)`; a placeholder that is no path is replaced too, by what `value` gives it. */\nexport const fillPlaceholders = (text: string, value: (path: string) => string) => text.replace(placeholder, (_, path: string) => value(path))\n\n/** A placeholder holding only a path, such as `{{website}}`: the path, or `undefined` when `text` is more than that. */\nexport const wholePlaceholder = (text: string) => {\n const match = /^\\{\\{\\s*([^{}]*?)\\s*\\}\\}$/.exec(text)\n return match && parseTemplatePath(match[1]!) ? match[1] : undefined\n}\n\n/**\n * The value at `path` in one record, as Mustache reads a single context: the first name from the record, the rest from\n * that value only. Anything that needs another context (`../`, `@root`) has none here, so it is `undefined`.\n */\nexport const recordValueAt = (record: Record<string, unknown>, path: string): unknown => {\n const parsed = parseTemplatePath(path)\n if (!parsed || parsed.kind !== 'context' || parsed.up > 0) return\n return parsed.names.reduce<unknown>((value, key) => (typeof value === 'object' && value !== null && Object.hasOwn(value, key) ? (value as Record<string, unknown>)[key] : undefined), record)\n}\n","import type { AppAddress } from './model'\nimport { fillPlaceholders, recordValueAt, templatePlaceholders, wholePlaceholder } from './template-path'\n\n/** How a filler reads the value at a path, such as `recordValueAt` on one record, or a layout's stack of records. */\nexport type PathLookup = (path: string) => unknown\n\nconst names = templatePlaceholders\n\n/** The path a link's address takes its resource from, when its `resource` is only `{{path}}`, as `'{{name}}'`. */\nexport const resourceField = (to: AppAddress) => (to.kind === 'page' ? undefined : wholePlaceholder(to.resource))\n\n/** The path a list address takes its whole filter from, when its `filter` is only `{{path}}`, as `'{{lever_filter}}'`: the record holds the filter's text. */\nexport const filterField = (to: AppAddress) => (to.kind === 'list' && to.filter !== undefined ? wholePlaceholder(to.filter) : undefined)\n\n// The parts of an address a `{{path}}` may stand in: a page's tab and parameters, the resource, the record key, tab, run and panel, the list's filter and order, a create form's values.\nconst templated = (to: AppAddress): string[] => {\n if (to.kind === 'page') return [...(to.tab === undefined ? [] : [to.tab]), ...Object.values(to.params ?? {})]\n const resource = resourceField(to) === undefined ? [] : [to.resource]\n if (to.kind === 'record') return [...resource, ...(Array.isArray(to.key) ? to.key : [to.key]).filter((part): part is string => typeof part === 'string'), ...[to.tab, to.run, to.panel].filter((part) => part !== undefined)]\n if (to.kind === 'list') return [...resource, ...[to.filter, to.orderBy].filter((part): part is string => part !== undefined)]\n return [...resource, ...Object.values(to.values ?? {})]\n}\n\n/** The paths whose values a link's address takes from the record, from its `{{path}}` placeholders. */\nexport const addressPlaceholders = (to: AppAddress) => [...new Set(templated(to).flatMap(names))]\n\n/** The paths a text, such as an href or a label, takes from the record, from its `{{path}}` placeholders. */\nexport const textPlaceholders = (text: string) => [...new Set(names(text))]\n\n/** The paths an href takes from the record, from its `{{path}}` placeholders. */\nexport const hrefPlaceholders = textPlaceholders\n\n/** `text` with every `{{path}}` replaced by `value(path)`, such as a button's label by the row's values as shown. */\nexport const fillText = fillPlaceholders\n\n/** A value as a placeholder writes it: a missing one empty. */\nexport const valueText = (value: unknown) => (value === null || value === undefined ? '' : String(value))\n\nconst fill = (text: string, lookup: PathLookup) => fillText(text, (path) => valueText(lookup(path)))\n\nconst filterPlaceholder = /([\"'])\\{\\{\\s*([^{}]*?)\\s*\\}\\}\\1|\\{\\{\\s*([^{}]*?)\\s*\\}\\}/g\n\n// A bare placeholder that is a comparison's value, as a typed layout writes `f.title.eq(data.title)`, or a function's\n// argument after the first, as in `in(title, {{title}})`: one bare word, such\n// as a number, a key or true, as it is; text that would break into more, such as a name with a space, quoted, so it\n// stays one value. Any other bare placeholder, a whole filter or a duration, goes in as it is.\nconst comparedValue = (value: unknown) => (typeof value === 'string' && value !== '' && !/^[\\w.:+-]+$/.test(value) ? JSON.stringify(value) : valueText(value))\n\nconst afterComparison = /(?:[=<>:,]|!=)\\s*$/\n\n/**\n * `filter` with every `{{path}}` replaced by its value. A quoted `'{{path}}'` takes the value as a string, its\n * backslashes and quotes escaped, so any text stays one value; Handlebars escapes for HTML instead, where this lands in\n * a filter or condition. A bare `{{path}}` that is a comparison's value, as a typed layout writes `f.title.eq(data.title)`,\n * takes one bare word as it is, such as a number or a key, and text with spaces or quotes quoted; any other bare one,\n * such as a whole filter or a duration, goes in as it is.\n */\nexport const fillFilter = (filter: string, lookup: PathLookup) =>\n filter.replace(filterPlaceholder, (_, quote: string | undefined, quoted: string | undefined, bare: string | undefined, at: number) => {\n if (quote) return `${quote}${valueText(lookup(quoted!)).replace(/\\\\/g, '\\\\\\\\').replaceAll(quote, `\\\\${quote}`)}${quote}`\n const value = lookup(bare!)\n return afterComparison.test(filter.slice(0, at)) ? comparedValue(value) : valueText(value)\n })\n\n/**\n * `to` with every `{{path}}` in its page parameters, resource, key, tab, run, panel, filter, order or values replaced by the value\n * `lookup` gives; a missing value becomes empty, and one quoted in a filter is escaped.\n */\nexport const fillAddressFrom = (to: AppAddress, lookup: PathLookup): AppAddress => {\n if (to.kind === 'page') return { ...to, ...(to.tab !== undefined && { tab: fill(to.tab, lookup) }), ...(to.params && { params: Object.fromEntries(Object.entries(to.params).map(([name, value]) => [name, fill(value, lookup)])) }) }\n const resource = resourceField(to) === undefined ? to.resource : fill(to.resource, lookup)\n if (to.kind === 'record') {\n const part = (value: string | number) => (typeof value === 'string' ? fill(value, lookup) : value)\n return { ...to, resource, key: Array.isArray(to.key) ? to.key.map(part) : part(to.key as string | number), ...(to.tab !== undefined && { tab: fill(to.tab, lookup) }), ...(to.run !== undefined && { run: fill(to.run, lookup) }), ...(to.panel !== undefined && { panel: fill(to.panel, lookup) }) }\n }\n if (to.kind === 'create') return { ...to, resource, ...(to.values && { values: Object.fromEntries(Object.entries(to.values).map(([name, value]) => [name, fill(value, lookup)])) }) }\n return { ...to, resource, ...(to.filter !== undefined && { filter: fillFilter(to.filter, lookup) }), ...(to.orderBy !== undefined && { orderBy: fill(to.orderBy, lookup) }) }\n}\n\n/** `to` with every `{{path}}` replaced by the record's value at that path. */\nexport const fillAddress = (to: AppAddress, record: Record<string, unknown> = {}): AppAddress => fillAddressFrom(to, (path) => recordValueAt(record, path))\n\n/** The paths a list address's filter takes outside quotes, whose values go into the filter as they are, such as `{{task_id}}` in `task_id = {{task_id}}`. */\nexport const bareFilterFields = (to: AppAddress) =>\n to.kind === 'list' && to.filter !== undefined ? [...new Set([...to.filter.matchAll(filterPlaceholder)].flatMap((match) => (match[3] === undefined ? [] : [match[3]])))] : []\n\nconst quotedLiteral = /([\"'])(?:\\\\[\\s\\S]|(?!\\1)[^\\\\])*\\1/g\n\nconst wholeQuoted = /^([\"'])\\{\\{\\s*[^{}]*?\\s*\\}\\}\\1$/\n\n/**\n * The paths a filter takes inside a longer quoted value, such as `{{name}}` in `title = 'abc{{name}}'`; only a quoted\n * value that is the placeholder alone is escaped when filled, so these are refused.\n */\nexport const embeddedFilterFields = (filter: string) => [...new Set([...filter.matchAll(quotedLiteral)].flatMap(([literal]) => (wholeQuoted.test(literal) ? [] : names(literal))))]\n\n/**\n * Whether an href leaves the app: it starts with a scheme (`https:`, `mailto:`) or `//`. A path inside the app is an\n * address, given as `to`, so that it is written one way everywhere.\n */\nexport const leavesApp = (href: string) => /^([a-z][a-z0-9+.-]*:|\\/\\/)/i.test(href)\n\n/** Why an href cannot be a link's `href`: it points inside the app, which takes an address in `to`. */\nexport const appHrefError = (href: string) =>\n leavesApp(href) ? undefined : `href \"${href}\" points inside the app; give the link \\`to\\` instead, an address such as { kind: 'record', resource: 'orders', key: '{{order_id}}' }`\n\n/** The path an action's href is made of alone, `{{field}}`: the record's value is the whole URL, as it is stored. */\nexport const hrefField = wholePlaceholder\n\n/** What a link action's label writes for the host its target opens. */\nexport const hostPlaceholder = '{{host}}'\n\n/**\n * Why a link action cannot be built: an `href` that points inside the app (one that is a single `{{field}}`, the URL the\n * record holds, is fine), or `{{host}}` in the label of a link that goes `to` an address in the app, which has no host.\n */\nexport const linkActionError = (label: string, run: { to: AppAddress } | { href: string }) => {\n if ('href' in run) return hrefField(run.href) ? undefined : appHrefError(run.href)\n return label.includes(hostPlaceholder) ? `the label names ${hostPlaceholder}, which only a link with an href has` : undefined\n}\n","/** How an enum value reads: its label from the view's `valueLabels`, else the stored value unchanged (`co_signer`). */\nexport const enumLabel = (value: string, labels?: Record<string, string>) => labels?.[value] ?? value\n","/**\n * @license lucide-react v1.52.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconData = {\n name: \"chevron-right\",\n size: 24,\n node: [[\"path\", { d: \"m9 18 6-6-6-6\", key: \"mthhwq\" }]]\n};\n__iconData.node;\nconst ChevronRight = createLucideIcon(__iconData);\n\nexport { __iconData, ChevronRight as default };\n//# sourceMappingURL=chevron-right.mjs.map\n","import type { CSSProperties } from 'react'\nimport { cn } from '../lib/cn'\n\n/**\n * A placeholder shaped like what is loading, which keeps that content's room. It stays blank for its first 180 ms, so a\n * load that quick shows no flash, then shimmers, or stays still when less motion is asked for.\n */\nexport const Skeleton = ({ className, style }: { className?: string; style?: CSSProperties }) => (\n <span className={cn('block h-3 rounded bg-muted', skeletonMotion, className)} style={style} />\n)\n\n/** Blank for the first 180 ms, for a loading notice such as a spinner, so a quick load never flashes it. */\nexport const revealLate = '[animation:pb-reveal_1ms_180ms_backwards]'\n\nconst skeletonMotion = '[animation:pb-reveal_1ms_180ms_backwards,pb-shimmer_1.4s_180ms_ease-in-out_infinite] motion-reduce:[animation:pb-reveal_1ms_180ms_backwards]'\n","import { messages } from '../locale/messages'\n\nexport const text = messages('app-shell')\n","import { ChevronRight } from 'lucide-react'\nimport type { MouseEvent } from 'react'\nimport { cn } from '../lib/cn'\nimport { Skeleton } from '../primitives/skeleton'\nimport { text } from './messages'\n\n/**\n * One step of the top bar's trail: plain text, or a link when it has a page of its own. A loading crumb shows a skeleton,\n * with its label for screen readers. A last crumb marked `above` is the page the shown one sits under, as a list is\n * above its record: it is not the current page, and on a phone the back button, which goes to it, shows its label.\n */\nexport type Crumb = string | { label: string; href?: string; loading?: boolean; above?: boolean }\n\nexport type BreadcrumbProps = {\n parts: Crumb[]\n /** Follows a crumb's link in the app; modified and middle clicks are left to the browser, so they open a new tab. */\n onNavigate?: (href: string) => void\n}\n\n/** A plain left click, which the app follows itself; others open a new tab. */\nexport const inApp = (event: MouseEvent) => event.button === 0 && !event.metaKey && !event.ctrlKey && !event.shiftKey && !event.altKey\n\n/** The trail of where you are; the current page, the last crumb unless it is `above`, shows on phones too. */\nexport const Breadcrumb = ({ parts, onNavigate }: BreadcrumbProps) => (\n <nav aria-label={text('breadcrumb')} className=\"flex min-w-0 items-center gap-1.5\">\n {parts.map((part, index) => {\n const last = index === parts.length - 1\n const { label, href, loading, above } = typeof part === 'string' ? { label: part, href: undefined, loading: false, above: false } : part\n const content = loading ? <Skeleton className=\"w-24\" /> : label\n const current = last && !above\n const text = cn('truncate', current ? 'font-semibold' : 'text-muted-foreground')\n return (\n <span key={`${index}-${label}`} className={cn('min-w-0 items-center gap-1.5', current ? 'flex' : 'hidden md:flex')}>\n {index > 0 && <ChevronRight className=\"hidden size-3.5 shrink-0 text-faint-foreground md:block\" />}\n {href ? (\n <a\n href={href}\n aria-current={current ? 'page' : undefined}\n aria-label={loading ? label : undefined}\n aria-busy={loading || undefined}\n onClick={(event) => {\n if (!onNavigate || !inApp(event)) return\n event.preventDefault()\n onNavigate(href)\n }}\n className={cn(text, 'rounded-sm hover:text-foreground hover:underline')}\n >\n {content}\n </a>\n ) : (\n <span className={text} aria-label={loading ? label : undefined} aria-busy={loading || undefined}>\n {content}\n </span>\n )}\n </span>\n )\n })}\n </nav>\n)\n","import type { AnchorHTMLAttributes } from 'react'\nimport { inApp } from '../app-shell/breadcrumb'\n\n/**\n * Where a link goes: the `href` the browser shows and opens, and how the app follows it in place. One without\n * `onFollow`, a page outside the app, the browser follows itself, in a new tab without the app's window or address\n * with `newTab`.\n */\nexport type RouteTarget = { href: string; onFollow?: () => void; newTab?: boolean }\n\n/**\n * An ordinary anchor to `to.href`: a plain click follows it in place with `to.onFollow`, while a middle click or one\n * with Ctrl, Cmd, Shift or Alt opens it in a new tab or window, or saves it, as on any link. Every navigation a click\n * starts is one of these, never a button that moves the page, so the browser shows where it goes and can open it.\n */\nexport const RouteLink = ({ to, onClick, ...rest }: AnchorHTMLAttributes<HTMLAnchorElement> & { to: RouteTarget }) => {\n const { href, onFollow, newTab } = to\n return (\n <a\n href={href}\n {...(newTab && { target: '_blank', rel: 'noreferrer' })}\n onClick={(event) => {\n onClick?.(event)\n if (!onFollow || event.defaultPrevented || !inApp(event)) return\n event.preventDefault()\n onFollow()\n }}\n {...rest}\n />\n )\n}\n","import { messages } from '../locale/messages'\n\n// Texts the app's pages share: the notices of an address that leads nowhere, and an error without words of its own\nexport const text = messages('app')\n","/** A static value a layout prop may hold: what survives `JSON.stringify` unchanged, plus elements (also plain data). */\nexport type LayoutValue = string | number | boolean | null | LayoutValue[] | { [key: string]: LayoutValue }\n\n/**\n * Which props of a block that reads records name what it reads: the resource, its filter, its sort, the fields it\n * draws and how many records it reads, so a page's reads can be planned from the tree. A block without one reads\n * nothing of its own. `fields` is a prop, or several, each holding a field name or a list of them. `select` is the\n * prop naming the page parameter that holds the key of the record chosen among them, inside which its children draw.\n */\nexport type BlockReads = { resource: string; filter?: string; sort?: string; fields?: string | string[]; limit?: string; select?: string }\n\n/**\n * What a custom component reads: one read, or several, each named by the prop of its resource (`nodes`, `edges`), as\n * the page's plan names them.\n */\nexport type ComponentReads = BlockReads | BlockReads[]\n\n/** One element of a layout tree. Plain data: it is sent to the browser as JSON and rendered there. */\nexport type LayoutNode = {\n /** A built-in block (`Table`) or a custom component's registered name. */\n type: string\n props: Record<string, LayoutValue>\n children: LayoutChild[]\n /** Set on custom components, which the app renders with the React component registered under `type`. */\n custom?: true\n /**\n * What a client draws in place of a custom component it does not have, or that fails to draw: elements and text,\n * or none to draw nothing. Absent when the component declares no fallback.\n */\n fallback?: LayoutChild[]\n /** Which of a custom component's props name what it reads, as its `component()` declares, so the page's plan reads it. */\n reads?: ComponentReads\n}\n\nexport type LayoutChild = LayoutNode | string\n\n/** What JSX accepts as children; `null`, `undefined` and booleans render nothing, like in React. */\nexport type LayoutChildren = LayoutChild | number | boolean | null | undefined | LayoutChildren[]\n\n/** A block as JSX sees it: called by the runtime with its props, it describes one element. */\nexport type Block<P> = ((props: P) => LayoutNode) & { readonly blockName: string; readonly custom: boolean; readonly fallback?: LayoutChild[]; readonly reads?: ComponentReads }\n\nexport const isLayoutNode = (value: unknown): value is LayoutNode =>\n typeof value === 'object' && value !== null && !Array.isArray(value) && typeof (value as LayoutNode).type === 'string' && Array.isArray((value as LayoutNode).children)\n\n/** An element's props without the elements it holds (`actions={...}`), which are walked as elements of their own. */\nexport const dataProps = (node: LayoutNode) =>\n Object.fromEntries(Object.entries(node.props).filter(([, value]) => !isLayoutNode(value) && !(Array.isArray(value) && value.length > 0 && value.every(isLayoutNode))))\n","import { messages } from '../locale/messages'\n\nexport const text = messages('format')\n","import { cachedFormat } from './intl-cache'\n\n// Times show in the viewer's time zone, the browser's; dates (`YYYY-MM-DD`, no time) have no zone and never shift.\n\n/** The viewer's IANA time zone, such as `Europe/Amsterdam`. */\nexport const viewerZone = () => Intl.DateTimeFormat().resolvedOptions().timeZone\n\nconst partsFormats = new Map<string, Intl.DateTimeFormat>()\n\nconst partsFormat = (zone: string) => {\n const known = partsFormats.get(zone)\n if (known) return known\n const format = new Intl.DateTimeFormat('en-US', { timeZone: zone, hourCycle: 'h23', year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', second: '2-digit' })\n partsFormats.set(zone, format)\n return format\n}\n\n// The wall clock of `zone` at `ms`, as numbers\nconst wallClock = (ms: number, zone: string) => {\n const parts = Object.fromEntries(partsFormat(zone).formatToParts(ms).map((part) => [part.type, part.value]))\n return { year: Number(parts.year), month: Number(parts.month), day: Number(parts.day), hour: Number(parts.hour), minute: Number(parts.minute), second: Number(parts.second) }\n}\n\n/** How far `zone`'s clock is ahead of UTC at `ms`, in milliseconds: 7 200 000 for Amsterdam in summer. */\nexport const zoneOffset = (ms: number, zone: string) => {\n const clock = wallClock(ms, zone)\n const asUtc = Date.UTC(clock.year, clock.month - 1, clock.day, clock.hour, clock.minute, clock.second)\n return asUtc - Math.floor(ms / 1000) * 1000\n}\n\nconst pad = (value: number) => String(value).padStart(2, '0')\n\n/** The day `ms` falls on in `zone`, as `YYYY-MM-DD`. */\nexport const dayIn = (ms: number, zone: string) => {\n const clock = wallClock(ms, zone)\n return `${clock.year}-${pad(clock.month)}-${pad(clock.day)}`\n}\n\n/** The instant `zone`'s clock reads `wall`, a wall-clock time written as if it were UTC milliseconds. */\nexport const instantAt = (wall: number, zone: string) => {\n // The offset at `wall` read as UTC is right unless the zone changes its clock in the hours between; a second pass fixes that\n const guess = wall - zoneOffset(wall, zone)\n return wall - zoneOffset(guess, zone)\n}\n\n/** The instant `day` (`YYYY-MM-DD`) starts in `zone`: its local midnight. */\nexport const startOfDayIn = (day: string, zone: string) => instantAt(Date.parse(`${day}T00:00:00Z`), zone)\n\n/** The zone a time is shown in, as its hover label says: \"Europe/Amsterdam (GMT+2)\", or \"UTC\". */\nexport const zoneLabel = (ms: number, zone: string) => {\n const named = cachedFormat(`zoneName:${zone}`, (tag) => new Intl.DateTimeFormat(tag, { timeZone: zone, timeZoneName: 'shortOffset' }))\n const name = named.formatToParts(ms).find((part) => part.type === 'timeZoneName')?.value ?? zone\n return zone === 'UTC' || zone === 'Etc/UTC' ? 'UTC' : `${zone} (${name})`\n}\n","import { cachedFormat } from './intl-cache'\nimport { text } from './messages'\nimport { viewerZone } from './zone'\n\n// Dates, months and weekdays are zone-free days, kept in UTC; times are the viewer's, in `zone`.\nconst dateFormat = (name: string, options: Intl.DateTimeFormatOptions) => () => cachedFormat(`date:${name}`, (tag) => new Intl.DateTimeFormat(tag, { ...options, timeZone: 'UTC' }))\nconst day = dateFormat('day', { day: 'numeric', month: 'short', year: 'numeric' })\nconst dayShort = dateFormat('dayShort', { day: 'numeric', month: 'short' })\nconst month = dateFormat('month', { month: 'long', year: 'numeric' })\nconst monthName = dateFormat('monthName', { month: 'long' })\nconst weekday = dateFormat('weekday', { weekday: 'short' })\nconst weekdayDate = dateFormat('weekdayDate', { weekday: 'long', day: 'numeric', month: 'short', year: 'numeric' })\n\nexport const formatDate = (ms: number) => day().format(ms)\n\nexport const formatDayShort = (ms: number) => dayShort().format(ms)\n\nconst zonedFormats = (zone: string) =>\n cachedFormat(`zoned:${zone}`, (tag) => ({\n day: new Intl.DateTimeFormat(tag, { day: 'numeric', month: 'short', year: 'numeric', timeZone: zone }),\n time: new Intl.DateTimeFormat(tag, { hour: '2-digit', minute: '2-digit', hour12: false, timeZone: zone }),\n }))\n\n/** \"6 Oct 2026, 16:32\": an instant on the clock of `zone`, the viewer's unless given. */\nexport const formatDateTime = (ms: number, zone = viewerZone()) => {\n const formats = zonedFormats(zone)\n return `${formats.day.format(ms)}, ${formats.time.format(ms)}`\n}\n\n/** \"October 2026\". */\nexport const formatMonth = (ms: number) => month().format(ms)\n\n/** \"October\". */\nexport const formatMonthName = (ms: number) => monthName().format(ms)\n\n/** \"October – December 2026\": the months from `from` to `to`, both included. */\nexport const formatMonthRange = (from: number, to: number) => month().formatRange(from, to)\n\n/** \"Mon\". */\nexport const formatWeekday = (ms: number) => weekday().format(ms)\n\n/** \"Monday, 12 Oct 2026\". */\nexport const formatWeekdayDate = (ms: number) => weekdayDate().format(ms)\n\n/** \"12–18 Oct 2026\", \"28 Dec 2026 – 3 Jan 2027\": the days from `from` to `to`, both included. */\nexport const formatDayRange = (from: number, to: number) => day().formatRange(from, to)\n\n/** \"09:30\": an instant's time on the clock of `zone`, the viewer's unless given. */\nexport const formatTime = (ms: number, zone = viewerZone()) => zonedFormats(zone).time.format(ms)\n\nexport const formatAgo = (seconds: number) => {\n if (seconds < 60) return text('secondsAgo', { count: seconds })\n if (seconds < 3600) return text('minutesAgo', { count: Math.floor(seconds / 60) })\n if (seconds < 86_400) return text('hoursAgo', { count: Math.floor(seconds / 3600) })\n return text('daysAgo', { count: Math.floor(seconds / 86_400) })\n}\n\nconst relative = () => cachedFormat('relative', (tag) => new Intl.RelativeTimeFormat(tag, { numeric: 'auto' }))\n\nconst units: Array<[Intl.RelativeTimeFormatUnit, number]> = [\n ['year', 31_536_000],\n ['month', 2_592_000],\n ['day', 86_400],\n ['hour', 3600],\n ['minute', 60],\n]\n\n/** \"5 minutes ago\", \"yesterday\", \"in 3 hours\"; `seconds` is how long ago it was, negative for a time to come. */\nexport const formatRelativeTime = (seconds: number) => {\n const away = Math.abs(seconds)\n const [unit, size] = units.find(([, size]) => away >= size) ?? ['second', 1]\n if (unit === 'second' && away < 45) return text('justNow')\n return relative().format(-Math.sign(seconds) * Math.floor(away / size), unit)\n}\n","import { messages } from '../locale/messages'\n\nexport const text = messages('live')\n","import type { StoredFile, UploadResult } from '@protobase/client'\nimport type { FieldModel } from '@protobase/schema'\nimport { text } from './messages'\n\n/** A file uploaded in the form and not yet saved: the ticket the save sends, and a local preview while there is one. */\nexport type FileDraft = { uploaded: UploadResult; preview?: string }\n\nexport const isStoredFile = (value: unknown): value is StoredFile =>\n typeof value === 'object' && value !== null && typeof (value as { uri?: unknown }).uri === 'string'\n\nexport const isFileDraft = (value: unknown): value is FileDraft =>\n typeof value === 'object' && value !== null && typeof (value as { uploaded?: { value?: unknown } }).uploaded?.value === 'string'\n\n/** What a file field shows: its name, type and size, whether stored or just uploaded; `undefined` when empty. */\nexport const fileShown = (value: unknown) => {\n if (isFileDraft(value)) return { ...value.uploaded.file, ...(value.preview && { url: value.preview }), corrected: value.uploaded.corrected }\n if (!isStoredFile(value)) return undefined\n if ('missing' in value) return { name: text('fileMissing'), type: '', missing: true as const }\n return value\n}\n\nconst units = ['bytes', 'kB', 'MB', 'GB']\n\n/** `48 kB`, `1.2 MB`: decimal units, like the field's `maxSize`. */\nexport const formatSize = (bytes: number) => {\n let size = bytes\n let unit = 0\n while (size >= 1000 && unit < units.length - 1) {\n size /= 1000\n unit += 1\n }\n return unit === 0 ? `${bytes} ${bytes === 1 ? 'byte' : 'bytes'}` : `${size < 10 ? size.toFixed(1) : Math.round(size)} ${units[unit]}`\n}\n\n/** Raster images the browser shows; SVG is never shown, since it can carry scripts. */\nexport const isPreviewable = (type: string) => type.startsWith('image/') && type !== 'image/svg+xml'\n\n/** Where a picture is drawn, in CSS pixels. */\nexport type ImageBox = { width: number; height: number }\n\n// An image for a box needs this many pixels per CSS pixel to stay sharp on a high-density screen.\nconst density = 2\n// A side a variant leaves unbounded counts as larger than any image.\nconst unbounded = 100_000\n\ntype Variant = { url: string; width?: number; height?: number }\n\nconst covers = (variant: Variant, box: ImageBox) =>\n (variant.width !== undefined || variant.height !== undefined) &&\n (variant.width ?? unbounded) >= box.width * density &&\n (variant.height ?? unbounded) >= box.height * density\n\nconst area = (variant: Variant) => (variant.width ?? unbounded) * (variant.height ?? unbounded)\n\n/**\n * The picture of a file for `box`: the link of its smallest variant large enough for it, else the file's own, with its\n * placeholder; `undefined` for a file that is no raster image with a link.\n */\nexport const shownImage = (value: unknown, box: ImageBox) => {\n const file = fileShown(value)\n if (!file || 'missing' in file || !file.url || !isPreviewable(file.type)) return undefined\n const variants: Variant[] = 'variants' in file && file.variants ? Object.values(file.variants) : []\n const best = variants.filter((variant) => covers(variant, box)).sort((a, b) => area(a) - area(b))[0]\n return { url: best?.url ?? file.url, ...('placeholder' in file && file.placeholder !== undefined && { placeholder: file.placeholder }) }\n}\n\n/** The file input's `accept`: the field's allowed types, or nothing when it takes any. */\nexport const acceptOf = (field: FieldModel) => {\n const accept = field.file?.accept ?? []\n return accept.length === 0 || accept.includes('*/*') ? undefined : accept.join(',')\n}\n\n/** What a save sends for a file field: the ticket of a new upload, `null` to clear it, the stored URI to keep it. */\nexport const filePatchValue = (draft: unknown) => {\n if (isFileDraft(draft)) return draft.uploaded.value\n if (isStoredFile(draft)) return draft.uri\n return null\n}\n\n/** Whether a file field's draft changes what is stored. */\nexport const fileDiffers = (draft: unknown, stored: unknown) => {\n if (isFileDraft(draft)) return true\n const uri = (value: unknown) => (isStoredFile(value) ? value.uri : null)\n return uri(draft) !== uri(stored)\n}\n","import type { ResourceModel } from '@protobase/schema'\n\nexport { labelFieldOf, recordTitle, recordTitleField } from '@protobase/schema/internal'\n\n// A key part of a record; a list row holds a relation as `{ id, name }`, so a relation key part is its `id`.\nconst keyPart = (model: ResourceModel, record: Record<string, unknown>, name: string) => {\n const value = record[name]\n const labelled = model.fields[name]?.type === 'relation' && typeof value === 'object' && value !== null && 'id' in value\n return (labelled ? value.id : value) as string | number\n}\n\nexport const recordId = (model: ResourceModel, record: Record<string, unknown>) =>\n model.primaryKey.map((name) => String(keyPart(model, record, name))).join(',')\n\n/** The key as the URL carries it, for `get` and `update`, from a stored record or a list row. */\nexport const recordKey = (model: ResourceModel, record: Record<string, unknown>) => {\n const parts = model.primaryKey.map((name) => keyPart(model, record, name))\n return parts.length === 1 ? parts[0]! : parts\n}\n","import { enumLabel, type FieldModel, type FieldViewModel } from '@protobase/schema'\nimport { formatDate, formatDateTime, formatRelativeTime } from '../format/date'\nimport { viewerZone, zoneLabel } from '../format/zone'\nimport { fileShown } from './file-values'\nimport { formatTag } from '../locale/active-locale'\nimport { text as message } from './messages'\n\n// A number with the view's prefix before it and suffix after it, such as `€1,200` or `120 m²`.\nconst affixed = (text: string, hints: FieldViewModel) => `${hints.prefix ?? ''}${text}${hints.suffix ?? ''}`\n\n/**\n * A read-only rendering of a stored value, following the view's prefix, suffix, decimals, format and value label hints; a\n * timestamp on the clock of `zone`, the viewer's unless given.\n */\nexport const displayValue = (field: FieldModel, value: unknown, hints: FieldViewModel = {}, zone = viewerZone(), now = Date.now()) => {\n if (value === null || value === undefined || value === '') return '—'\n switch (field.type) {\n case 'boolean':\n return value ? message('yes') : message('no')\n case 'file':\n return fileShown(value)?.name ?? '—'\n case 'enum':\n return enumLabel(String(value), hints.valueLabels)\n case 'timestamp': {\n const ms = Date.parse(String(value))\n return hints.format === 'relative' ? formatRelativeTime(Math.round((now - ms) / 1000)) : formatDateTime(ms, zone)\n }\n case 'date':\n return formatDate(Date.parse(String(value)))\n case 'decimal': {\n const text = hints.decimals === undefined ? String(value) : Number(value).toFixed(hints.decimals)\n if (hints.format === 'percent') return `${Number(value)}%`\n return affixed(Number(text).toLocaleString(formatTag(), { minimumFractionDigits: hints.decimals ?? 0, maximumFractionDigits: hints.decimals ?? 20 }), hints)\n }\n case 'integer':\n case 'bigint':\n return affixed(String(value), hints)\n default:\n return typeof value === 'object' ? JSON.stringify(value) : String(value)\n }\n}\n\n/** The hover label of a shown value: the time zone a timestamp is shown in, or its exact time when shown relative; nothing for other values. */\nexport const valueTitle = (field: FieldModel, value: unknown, zone = viewerZone(), hints: FieldViewModel = {}) => {\n if (field.type !== 'timestamp' || typeof value !== 'string') return undefined\n const ms = Date.parse(value)\n if (Number.isNaN(ms)) return undefined\n if (hints.format === 'relative') return formatDateTime(ms, zone)\n return message('shownIn', { zone: zoneLabel(ms, zone) })\n}\n"],"ignoreList":[3],"mappings":"mrBAGA,IAAMe,EAAO,yBACPC,EAAW,GAAGD,EAAK,QAAQA,EAAK,IAChCE,EAAa,yBAAyBD,EAAS,kDAAkDA,EAAS,SAASA,EAAS,GAAGA,EAAS,GAExIE,EAAgB,OAAO,OAAOD,EAAW,GAAG,EAG5CE,EAAc,2BAYPC,EAAqB,GAA2C,CAC3E,GAAI,CAACF,EAAU,KAAKG,CAAI,EAAG,OAC3B,GAAIA,EAAK,WAAW,GAAG,EAAG,CACxB,GAAM,CAACC,EAAU,GAAGC,GAASF,EAAK,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,EACpD,MAAO,CAAE,KAAM,OAAkB,WAA4D,OAAM,CACrG,CACA,IAAIG,EAAOH,EACPI,EAAK,EACT,KAAOD,EAAK,WAAW,KAAK,GAC1B,EAAOA,EAAK,MAAM,CAAC,EACnB,GAAM,EAKR,OAHIA,IAAS,OAAe,CAAE,KAAM,UAAW,KAAI,SAAU,GAAM,MAAO,CAAC,CAAE,EACzEA,EAAK,WAAW,OAAO,EAAU,CAAE,KAAM,UAAW,KAAI,SAAU,GAAM,MAAOA,EAAK,MAAM,CAAC,CAAC,CAAC,MAAM,GAAG,CAAE,EACxGA,EAAK,WAAW,IAAI,EAAU,CAAE,KAAM,UAAW,KAAI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