@homepages/concrete 1.0.0

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 (327) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +174 -0
  3. package/codemods/manifest.json +9 -0
  4. package/dist/artifact/playground/client/assets/index-BSA1yutg.css +1 -0
  5. package/dist/artifact/playground/client/assets/index-JloQyj8h.js +1101 -0
  6. package/dist/artifact/playground/client/index.html +13 -0
  7. package/dist/artifact/playground/client/island-canvas-host.mjs +1 -0
  8. package/dist/artifact/playground/host.mjs +127 -0
  9. package/dist/asset-modules.d.ts +99 -0
  10. package/dist/base.css +220 -0
  11. package/dist/browser/site-config.d.ts +18 -0
  12. package/dist/browser/site-config.js +56 -0
  13. package/dist/browser/submit-lead.d.ts +98 -0
  14. package/dist/browser/submit-lead.js +188 -0
  15. package/dist/browser.d.ts +3 -0
  16. package/dist/browser.js +4 -0
  17. package/dist/cli/build/artifact.js +225 -0
  18. package/dist/cli/build/captures.js +67 -0
  19. package/dist/cli/build/esbuild.js +127 -0
  20. package/dist/cli/build/fixtures.js +96 -0
  21. package/dist/cli/build/icons.js +76 -0
  22. package/dist/cli/build/index.js +38 -0
  23. package/dist/cli/build/playground.js +31 -0
  24. package/dist/cli/build/sections.js +236 -0
  25. package/dist/cli/build/source.js +62 -0
  26. package/dist/cli/build/static.js +156 -0
  27. package/dist/cli/capture/bundle.js +37 -0
  28. package/dist/cli/capture/capture-browser.js +51 -0
  29. package/dist/cli/capture/capture.js +121 -0
  30. package/dist/cli/check/analyze.js +95 -0
  31. package/dist/cli/check/index.js +19 -0
  32. package/dist/cli/check/load-workspace.js +119 -0
  33. package/dist/cli/check/messages.js +16 -0
  34. package/dist/cli/check/render/class-conflicts.js +39 -0
  35. package/dist/cli/check/render/html.js +86 -0
  36. package/dist/cli/check/render/inputs.js +53 -0
  37. package/dist/cli/check/render/invariants.js +58 -0
  38. package/dist/cli/check/render/island-frames.js +72 -0
  39. package/dist/cli/check/render/marker-coverage.js +102 -0
  40. package/dist/cli/check/render/nav.js +64 -0
  41. package/dist/cli/check/report.js +73 -0
  42. package/dist/cli/check/stages/bundles.js +129 -0
  43. package/dist/cli/check/stages/composition.js +67 -0
  44. package/dist/cli/check/stages/contracts.js +22 -0
  45. package/dist/cli/check/stages/dependencies.js +261 -0
  46. package/dist/cli/check/stages/fixtures.js +74 -0
  47. package/dist/cli/check/stages/lint.js +41 -0
  48. package/dist/cli/check/stages/logic.js +63 -0
  49. package/dist/cli/check/stages/render.js +144 -0
  50. package/dist/cli/check/stages/sections.js +83 -0
  51. package/dist/cli/check/stages/stylesheet.js +31 -0
  52. package/dist/cli/check/stages/typecheck.js +68 -0
  53. package/dist/cli/check/stages/workspace.js +26 -0
  54. package/dist/cli/commands.js +342 -0
  55. package/dist/cli/currency/cache.js +89 -0
  56. package/dist/cli/currency/decide.js +65 -0
  57. package/dist/cli/currency/opt-out.js +16 -0
  58. package/dist/cli/currency/preamble.js +183 -0
  59. package/dist/cli/currency/prompt.js +28 -0
  60. package/dist/cli/currency/refresh.js +44 -0
  61. package/dist/cli/currency/resolve-latest.js +185 -0
  62. package/dist/cli/currency/version-order.js +38 -0
  63. package/dist/cli/dev/crop.js +22 -0
  64. package/dist/cli/dev/hmr.js +26 -0
  65. package/dist/cli/dev/http.js +129 -0
  66. package/dist/cli/dev/index.js +70 -0
  67. package/dist/cli/dev/islands.js +390 -0
  68. package/dist/cli/dev/load-template.js +46 -0
  69. package/dist/cli/dev/request-error.js +22 -0
  70. package/dist/cli/dev/server.js +307 -0
  71. package/dist/cli/dev/tsconfig-paths.js +95 -0
  72. package/dist/cli/dev/vite.js +85 -0
  73. package/dist/cli/dev/workspace-reader.js +274 -0
  74. package/dist/cli/io.d.ts +14 -0
  75. package/dist/cli/media/cache.js +125 -0
  76. package/dist/cli/media/derive.js +252 -0
  77. package/dist/cli/media/deriver-plugin.js +71 -0
  78. package/dist/cli/property/index.js +180 -0
  79. package/dist/cli/property/library.js +137 -0
  80. package/dist/cli/publish/client.js +119 -0
  81. package/dist/cli/publish/freshness.js +66 -0
  82. package/dist/cli/publish/git.js +43 -0
  83. package/dist/cli/publish/index.js +207 -0
  84. package/dist/cli/publish/pack.js +78 -0
  85. package/dist/cli/publish/report.js +98 -0
  86. package/dist/cli/publish/target.js +87 -0
  87. package/dist/cli/publish/wire.js +29 -0
  88. package/dist/cli/tar.js +87 -0
  89. package/dist/cli/upgrade/codemod.js +56 -0
  90. package/dist/cli/upgrade/index.js +263 -0
  91. package/dist/cli/upgrade/manifest.js +72 -0
  92. package/dist/cli/upgrade/plan.js +68 -0
  93. package/dist/cli/upgrade/stage.js +71 -0
  94. package/dist/cli/version.d.ts +12 -0
  95. package/dist/cli/version.js +15 -0
  96. package/dist/cli/workspace.js +108 -0
  97. package/dist/cli.d.ts +6 -0
  98. package/dist/cli.js +94 -0
  99. package/dist/css/compile.js +77 -0
  100. package/dist/css/graph.js +109 -0
  101. package/dist/css/inline.js +132 -0
  102. package/dist/css/rules.js +65 -0
  103. package/dist/design-system/format-variants.js +127 -0
  104. package/dist/eslint/authoring.js +46 -0
  105. package/dist/eslint/correctness.js +42 -0
  106. package/dist/eslint/rules/editor-declaration.js +103 -0
  107. package/dist/eslint/rules/editor-reason.js +135 -0
  108. package/dist/eslint/rules/island-imports.js +20 -0
  109. package/dist/eslint/rules/jsx-visitor.js +20 -0
  110. package/dist/eslint/rules/no-client-runtime.js +88 -0
  111. package/dist/eslint/rules/no-editor-globals.js +60 -0
  112. package/dist/eslint/rules/no-hard-coded-color.js +183 -0
  113. package/dist/eslint/rules/no-inline-style.js +24 -0
  114. package/dist/eslint/rules/no-marker-literal.js +37 -0
  115. package/dist/eslint/rules/no-nondeterminism.js +44 -0
  116. package/dist/eslint/rules/no-px-breakpoint.js +44 -0
  117. package/dist/eslint/rules/no-raw-values.js +45 -0
  118. package/dist/eslint/rules/serializable-props.js +95 -0
  119. package/dist/eslint.d.ts +6 -0
  120. package/dist/eslint.js +26 -0
  121. package/dist/fixtures/brand.d.ts +4 -0
  122. package/dist/fixtures/brand.js +9 -0
  123. package/dist/fixtures/bundle-rule.js +67 -0
  124. package/dist/fixtures/canonical.d.ts +149 -0
  125. package/dist/fixtures/image-dimensions.js +59 -0
  126. package/dist/fixtures/load.js +154 -0
  127. package/dist/fixtures/media-plugin.js +141 -0
  128. package/dist/fixtures/media.js +165 -0
  129. package/dist/fixtures/property.js +210 -0
  130. package/dist/fixtures/resolve.js +202 -0
  131. package/dist/fixtures/rows.js +108 -0
  132. package/dist/fixtures/synthesize-empties.js +42 -0
  133. package/dist/fixtures.d.ts +213 -0
  134. package/dist/fixtures.js +37 -0
  135. package/dist/index.d.ts +53 -0
  136. package/dist/index.js +37 -0
  137. package/dist/islands/client-module.js +97 -0
  138. package/dist/islands/marker.d.ts +43 -0
  139. package/dist/islands/marker.js +44 -0
  140. package/dist/node_modules/.pnpm/fflate@0.8.3/node_modules/fflate/esm/browser.js +687 -0
  141. package/dist/packages/external/concrete/package.js +5 -0
  142. package/dist/packages/internal/fact-interpolation/dist/index.js +22 -0
  143. package/dist/packages/internal/fill-bake/dist/bake-property-ref.js +111 -0
  144. package/dist/packages/internal/fill-bake/dist/display.js +9 -0
  145. package/dist/packages/internal/fill-bake/dist/index.js +6 -0
  146. package/dist/packages/internal/fill-bake/dist/reconcile-cross-section.js +170 -0
  147. package/dist/packages/internal/fill-vocabulary/dist/facts.d.ts +32 -0
  148. package/dist/packages/internal/fill-vocabulary/dist/facts.js +131 -0
  149. package/dist/packages/internal/fill-vocabulary/dist/row-planners.js +73 -0
  150. package/dist/packages/internal/format-geometry/dist/capture.js +404 -0
  151. package/dist/packages/internal/format-geometry/dist/format.d.ts +41 -0
  152. package/dist/packages/internal/format-geometry/dist/geometry.js +58 -0
  153. package/dist/packages/internal/format-geometry/dist/index.js +4 -0
  154. package/dist/packages/internal/image-descriptor/dist/index.d.ts +35 -0
  155. package/dist/packages/internal/image-ladder/dist/crop.js +82 -0
  156. package/dist/packages/internal/image-ladder/dist/encode.js +23 -0
  157. package/dist/packages/internal/image-ladder/dist/index.js +4 -0
  158. package/dist/packages/internal/image-ladder/dist/policy.js +102 -0
  159. package/dist/packages/internal/island-runtime/dist/capture-holds.d.ts +13 -0
  160. package/dist/packages/internal/island-runtime/dist/capture-holds.js +45 -0
  161. package/dist/packages/internal/island-runtime/dist/contract.d.ts +176 -0
  162. package/dist/packages/internal/island-runtime/dist/contract.js +94 -0
  163. package/dist/packages/internal/island-runtime/dist/editor-instance-context.js +15 -0
  164. package/dist/packages/internal/island-runtime/dist/index.d.ts +103 -0
  165. package/dist/packages/internal/island-runtime/dist/index.js +163 -0
  166. package/dist/packages/internal/island-runtime/dist/use-capture-ready.d.ts +19 -0
  167. package/dist/packages/internal/island-runtime/dist/use-capture-ready.js +39 -0
  168. package/dist/packages/internal/island-runtime/dist/use-editor.d.ts +22 -0
  169. package/dist/packages/internal/island-runtime/dist/use-editor.js +54 -0
  170. package/dist/packages/internal/island-runtime/dist/viewport-schedule.js +105 -0
  171. package/dist/packages/internal/property-facts/dist/derive-facts-view.js +25 -0
  172. package/dist/packages/internal/property-facts/dist/index.js +3 -0
  173. package/dist/packages/internal/property-facts/dist/property-facts-CSdkSuD7.js +181 -0
  174. package/dist/packages/internal/section-contracts/dist/cap-contract.js +59 -0
  175. package/dist/packages/internal/section-contracts/dist/catalog.js +102 -0
  176. package/dist/packages/internal/section-contracts/dist/choose-select-contract.js +24 -0
  177. package/dist/packages/internal/section-contracts/dist/count-bounds-contract.js +48 -0
  178. package/dist/packages/internal/section-contracts/dist/display-contract.js +30 -0
  179. package/dist/packages/internal/section-contracts/dist/display-evidence-contract.js +17 -0
  180. package/dist/packages/internal/section-contracts/dist/group-contract.js +21 -0
  181. package/dist/packages/internal/section-contracts/dist/index.js +26 -0
  182. package/dist/packages/internal/section-contracts/dist/interpolation-contract.js +48 -0
  183. package/dist/packages/internal/section-contracts/dist/list-fill-contract.js +53 -0
  184. package/dist/packages/internal/section-contracts/dist/list-scalar-contract.js +70 -0
  185. package/dist/packages/internal/section-contracts/dist/name-title-contract.js +27 -0
  186. package/dist/packages/internal/section-contracts/dist/nested-slot-contract.js +12 -0
  187. package/dist/packages/internal/section-contracts/dist/option-source-contract.js +22 -0
  188. package/dist/packages/internal/section-contracts/dist/poi-curation-contract.js +18 -0
  189. package/dist/packages/internal/section-contracts/dist/pooling-field-contract.js +30 -0
  190. package/dist/packages/internal/section-contracts/dist/record-collection-contract.js +24 -0
  191. package/dist/packages/internal/section-contracts/dist/row-contract.js +37 -0
  192. package/dist/packages/internal/section-contracts/dist/row-fill-contract.js +38 -0
  193. package/dist/packages/internal/section-contracts/dist/runners.js +181 -0
  194. package/dist/packages/internal/section-contracts/dist/select-contract.js +28 -0
  195. package/dist/packages/internal/section-contracts/dist/source-contract.js +48 -0
  196. package/dist/packages/internal/section-contracts/dist/source-filter-contract.js +15 -0
  197. package/dist/packages/internal/section-contracts/dist/sources-contract.js +28 -0
  198. package/dist/packages/internal/section-contracts/dist/url-contract.js +20 -0
  199. package/dist/packages/internal/source-resolution/dist/index.js +222 -0
  200. package/dist/packages/internal/template-artifact/dist/hash.js +50 -0
  201. package/dist/packages/internal/template-artifact/dist/index.js +7 -0
  202. package/dist/packages/internal/template-artifact/dist/layout.js +165 -0
  203. package/dist/packages/internal/template-artifact/dist/manifest.js +73 -0
  204. package/dist/packages/internal/template-artifact/dist/sha256.js +138 -0
  205. package/dist/packages/internal/template-artifact/dist/verify.js +275 -0
  206. package/dist/packages/internal/template-contracts/dist/collection-editing.js +38 -0
  207. package/dist/packages/internal/template-contracts/dist/content-categories.d.ts +10 -0
  208. package/dist/packages/internal/template-contracts/dist/content-categories.js +17 -0
  209. package/dist/packages/internal/template-contracts/dist/document-value.d.ts +33 -0
  210. package/dist/packages/internal/template-contracts/dist/facts-view.d.ts +81 -0
  211. package/dist/packages/internal/template-contracts/dist/facts-view.js +136 -0
  212. package/dist/packages/internal/template-contracts/dist/layout.js +17 -0
  213. package/dist/packages/internal/template-contracts/dist/markers.d.ts +40 -0
  214. package/dist/packages/internal/template-contracts/dist/markers.js +41 -0
  215. package/dist/packages/internal/template-contracts/dist/poi-row.d.ts +63 -0
  216. package/dist/packages/internal/template-contracts/dist/select-key.js +13 -0
  217. package/dist/packages/internal/template-contracts/dist/slot-catalog.d.ts +1112 -0
  218. package/dist/packages/internal/template-contracts/dist/slot-catalog.js +1109 -0
  219. package/dist/packages/internal/template-contracts/dist/slot-overrides.js +11 -0
  220. package/dist/packages/internal/template-contracts/dist/tour-value.d.ts +45 -0
  221. package/dist/packages/internal/template-contracts/dist/video-value.d.ts +63 -0
  222. package/dist/playground/host/page-state.js +12 -0
  223. package/dist/playground/host/paths.js +9 -0
  224. package/dist/playground/layout.js +24 -0
  225. package/dist/playground/wire.js +36 -0
  226. package/dist/playground-island-runtime.d.ts +3 -0
  227. package/dist/playground-island-runtime.js +4 -0
  228. package/dist/primitives/FrameShell.d.ts +29 -0
  229. package/dist/primitives/FrameShell.js +34 -0
  230. package/dist/primitives/Image.d.ts +119 -0
  231. package/dist/primitives/Image.js +173 -0
  232. package/dist/primitives/Section.d.ts +22 -0
  233. package/dist/primitives/Section.js +26 -0
  234. package/dist/primitives/Tour.d.ts +43 -0
  235. package/dist/primitives/Tour.js +72 -0
  236. package/dist/primitives/Video.d.ts +57 -0
  237. package/dist/primitives/Video.js +116 -0
  238. package/dist/primitives/embed-playback.js +50 -0
  239. package/dist/primitives/index.d.ts +11 -0
  240. package/dist/primitives/marker-attrs.js +44 -0
  241. package/dist/primitives/object-fit.js +11 -0
  242. package/dist/primitives/picture-sources.d.ts +24 -0
  243. package/dist/primitives/picture-sources.js +52 -0
  244. package/dist/primitives/probe-context.js +24 -0
  245. package/dist/primitives/slot-bindings.d.ts +96 -0
  246. package/dist/primitives/slot-bindings.js +226 -0
  247. package/dist/primitives/slot-document.d.ts +35 -0
  248. package/dist/primitives/slot-document.js +37 -0
  249. package/dist/primitives/slot-group.d.ts +40 -0
  250. package/dist/primitives/slot-group.js +45 -0
  251. package/dist/primitives/slot-list.d.ts +21 -0
  252. package/dist/primitives/slot-list.js +23 -0
  253. package/dist/primitives/slot-media.d.ts +71 -0
  254. package/dist/primitives/slot-media.js +98 -0
  255. package/dist/primitives/slot-scalar.d.ts +53 -0
  256. package/dist/primitives/slot-scalar.js +98 -0
  257. package/dist/primitives/slot.d.ts +26 -0
  258. package/dist/primitives/slot.js +28 -0
  259. package/dist/rules/registry.js +479 -0
  260. package/dist/schema/compute.d.ts +22 -0
  261. package/dist/schema/compute.js +30 -0
  262. package/dist/schema/define-schema.d.ts +27 -0
  263. package/dist/schema/define-schema.js +73 -0
  264. package/dist/schema/extract-fill-spec.js +246 -0
  265. package/dist/schema/extract-used-facts.js +176 -0
  266. package/dist/schema/fact.d.ts +65 -0
  267. package/dist/schema/fact.js +33 -0
  268. package/dist/schema/fill-builders.d.ts +387 -0
  269. package/dist/schema/fill-builders.js +263 -0
  270. package/dist/schema/fill-declaration.d.ts +76 -0
  271. package/dist/schema/fill-declaration.js +43 -0
  272. package/dist/schema/fill-spec.d.ts +18 -0
  273. package/dist/schema/fill-spec.js +170 -0
  274. package/dist/schema/format-presets.d.ts +27 -0
  275. package/dist/schema/format-presets.js +76 -0
  276. package/dist/schema/format.d.ts +22 -0
  277. package/dist/schema/format.js +40 -0
  278. package/dist/schema/formats.d.ts +6 -0
  279. package/dist/schema/formats.js +7 -0
  280. package/dist/schema/layout.d.ts +32 -0
  281. package/dist/schema/layout.js +30 -0
  282. package/dist/schema/manifest.js +300 -0
  283. package/dist/schema/property-facts.d.ts +83 -0
  284. package/dist/schema/runtime-values.d.ts +88 -0
  285. package/dist/schema/section-nav.d.ts +38 -0
  286. package/dist/schema/section-nav.js +29 -0
  287. package/dist/schema/section-props.d.ts +98 -0
  288. package/dist/schema/section-schema.d.ts +53 -0
  289. package/dist/schema/section-schema.js +54 -0
  290. package/dist/schema/slot-builders.d.ts +497 -0
  291. package/dist/schema/slot-builders.js +331 -0
  292. package/dist/schema/slot-types.d.ts +110 -0
  293. package/dist/schema/slot-types.js +187 -0
  294. package/dist/section/declare.d.ts +44 -0
  295. package/dist/section/declare.js +27 -0
  296. package/dist/section/discovery.js +76 -0
  297. package/dist/section/groups.js +74 -0
  298. package/dist/section/materialize.js +28 -0
  299. package/dist/section/placements.js +28 -0
  300. package/dist/section/section.d.ts +69 -0
  301. package/dist/section/section.js +101 -0
  302. package/dist/site-analytics.d.ts +1 -0
  303. package/dist/site-analytics.js +15 -0
  304. package/dist/site-runtime/analytics.js +97 -0
  305. package/dist/site-runtime/site-integrations.js +97 -0
  306. package/dist/styles.css +60 -0
  307. package/dist/template/define-template.d.ts +139 -0
  308. package/dist/template/define-template.js +98 -0
  309. package/dist/template/logic-build.js +191 -0
  310. package/dist/template/logic-shim.d.ts +43 -0
  311. package/dist/template/logic-shim.js +52 -0
  312. package/dist/template/logic-transform.js +92 -0
  313. package/dist/template/materialize.js +107 -0
  314. package/dist/template/reconcile.d.ts +67 -0
  315. package/dist/template/reconcile.js +25 -0
  316. package/dist/template/running-copy.js +58 -0
  317. package/guide/reference/cli/INDEX.md +79 -0
  318. package/guide/reference/cli/build.md +48 -0
  319. package/guide/reference/cli/check.md +49 -0
  320. package/guide/reference/cli/dev.md +46 -0
  321. package/guide/reference/cli/property-add.md +53 -0
  322. package/guide/reference/cli/property-list.md +46 -0
  323. package/guide/reference/cli/publish.md +54 -0
  324. package/guide/reference/cli/upgrade.md +48 -0
  325. package/guide/reference/rules/INDEX.md +190 -0
  326. package/package.json +137 -0
  327. package/tsconfig.base.json +16 -0
@@ -0,0 +1,1109 @@
1
+ //#region ../../internal/template-contracts/dist/slot-catalog.js
2
+ /** Standard content slot types — AI-fillable or user-editable freeform. */
3
+ const CONTENT_SLOT_TYPES = [
4
+ "text",
5
+ "number",
6
+ "select",
7
+ "image",
8
+ "list",
9
+ "poi",
10
+ "url",
11
+ "video",
12
+ "tour",
13
+ "document"
14
+ ];
15
+ /**
16
+ * Reference slot types — a slot type bound via the `source` axis / baked from facts rather than authored/AI-filled.
17
+ *
18
+ * @remarks
19
+ * Currently empty: no slot type is source-bound at the type level. A slot's
20
+ * provenance is expressed by its `source` axis kind (`authored` / `direct` /
21
+ * `derived`) instead, orthogonal to its content slot type.
22
+ */
23
+ const REF_SLOT_TYPES = [];
24
+ /** Every slot type, content and reference combined. */
25
+ const SLOT_TYPES = [...CONTENT_SLOT_TYPES, ...REF_SLOT_TYPES];
26
+ /** The collection slot types — every kind whose runtime value is an array of items. */
27
+ const COLLECTION_SLOT_TYPES = ["list"];
28
+ /** Whether `type` names a collection slot type. */
29
+ function isCollectionSlotType(type) {
30
+ return COLLECTION_SLOT_TYPES.includes(type);
31
+ }
32
+ /**
33
+ * The asset-pool filters an `image` slot's `sourceFilter` may name — the tag that narrows the candidate pool the editor offers for that slot.
34
+ *
35
+ * @remarks
36
+ * `"floorplans"` routes the slot to the per-unit floor-plan picker rather than
37
+ * the property photo pool. The vocabulary is closed and checked at authoring
38
+ * time (`assertSourceFilterContract`) because an unrecognized tag is invisible:
39
+ * the editor simply falls through to the ordinary photo pool, with no error
40
+ * anywhere and no way to tell that from an author who meant that pool.
41
+ */
42
+ const SOURCE_FILTERS = ["floorplans"];
43
+ /** Whether `value` names a real asset-pool filter. */
44
+ function isSourceFilter(value) {
45
+ return SOURCE_FILTERS.includes(value);
46
+ }
47
+ /**
48
+ * Referral-provider field names a slot may bind to via `source.kind:"direct"` on a named property-level referral (v1: `"primary_contact"`).
49
+ *
50
+ * @remarks
51
+ * Names the referral-specific fields, as distinct from the property/unit
52
+ * scalars in `SOURCE_FIELDS`, for slot-type cross-checks. The
53
+ * field-to-contact-card-key translation applied when a value is baked is not
54
+ * part of this kit.
55
+ */
56
+ const REFERRAL_FIELDS = [
57
+ "name",
58
+ "title",
59
+ "org_name",
60
+ "email",
61
+ "phone",
62
+ "website",
63
+ "instagram",
64
+ "linkedin",
65
+ "x",
66
+ "facebook",
67
+ "headshot",
68
+ "logo_dark",
69
+ "logo_light"
70
+ ];
71
+ /**
72
+ * The subset of `REFERRAL_FIELDS` whose slot type is `image` rather than scalar text — a baked value for these is an `ImageValue`, not a string.
73
+ */
74
+ const REFERRAL_IMAGE_FIELDS = [
75
+ "headshot",
76
+ "logo_dark",
77
+ "logo_light"
78
+ ];
79
+ /**
80
+ * The askable units a fact can belong to — the key space of `FACT_GRAPH`'s
81
+ * `input_group`, and the vocabulary the app's input-group registry implements.
82
+ *
83
+ * @remarks
84
+ * A VOCABULARY, not an order. Which question comes before which is pure
85
+ * presentation and stays app-owned (the ordered registry that renders the
86
+ * intake steps and the Details sections); the server never needs it, so
87
+ * declaring an order here would be a second, drifting copy of one.
88
+ *
89
+ * Only groups a FACT can belong to are members. `domain` is absent because a
90
+ * web address is a website input rather than a property fact and never enters
91
+ * the graph; the template selection is absent for the same reason — nothing
92
+ * about it is a fact about the property.
93
+ */
94
+ const INPUT_GROUPS = [
95
+ "address",
96
+ "type",
97
+ "intent",
98
+ "describe",
99
+ "uploads",
100
+ "units",
101
+ "comparables",
102
+ "contacts"
103
+ ];
104
+ /**
105
+ * When each askable unit's question is owed — the one declaration of the group conditional axis.
106
+ *
107
+ * @remarks
108
+ * Every base group is always-on except three: `units`, `comparables` and
109
+ * `contacts` are each asked only of a property whose templates read one of the
110
+ * group's facts. A template that never binds, reads or computes over a unit
111
+ * fact — a document-sourced investment fact sheet, say — neither asks for unit
112
+ * details nor gates Generate on them; one that never reaches a contact fact
113
+ * asks for no contact either, unless it is a website, which
114
+ * {@link WEBSITE_ASKED_INPUT_GROUPS} summons the contacts for regardless.
115
+ * See {@link InputGroupRequirementKind}.
116
+ */
117
+ const INPUT_GROUP_REQUIREMENT = {
118
+ address: "always",
119
+ type: "always",
120
+ intent: "always",
121
+ describe: "always",
122
+ uploads: "always",
123
+ units: "derived",
124
+ comparables: "derived",
125
+ contacts: "derived"
126
+ };
127
+ /**
128
+ * The askable units every property is asked for, whatever its templates use.
129
+ *
130
+ * @remarks
131
+ * The always-on leg of requiredness, as a list. A reader that grades
132
+ * requiredness needs both legs and gets the conditional one from the subjects
133
+ * it holds; this is the half that needs no subjects at all.
134
+ */
135
+ const ALWAYS_ASKED_INPUT_GROUPS = INPUT_GROUPS.filter((group) => INPUT_GROUP_REQUIREMENT[group] === "always");
136
+ /**
137
+ * The single description of every fact an author can reach — the whole property fact graph, bindable and readable-only alike.
138
+ *
139
+ * @remarks
140
+ * Every canonical `property_facts.facts` path is either an entry here (or a
141
+ * member of one) or carries a stated reason on `FACT_GRAPH_EXCLUSIONS`; a
142
+ * completeness gate holds that exactly, top level and row level.
143
+ * Each entry's own doc comment is the hover text an author sees on the
144
+ * matching `fact.*` entry elsewhere in the schema layer, so keep every entry
145
+ * documented — that sentence is the only way an author distinguishes
146
+ * `fact.unit.beds` from `fact.property.property_type` without opening this file.
147
+ * The bindable entries are declared in the order `fact.*` presents them.
148
+ *
149
+ * It is also where a fact's CONDITIONAL axis is declared — `input_group` (the
150
+ * askable unit whose question produces it) and `strength` (whether that
151
+ * question gates Generate). Both live on the fact rather than on the template
152
+ * that uses it, which is what lets a fact be re-grouped or re-weighted without
153
+ * republishing a single template: a published template stores only the fact
154
+ * KEYS it uses, and the group and strength are joined from here at read time.
155
+ */
156
+ const FACT_GRAPH = {
157
+ /** Street address, resolved to its display form. Read-only. */
158
+ address: {
159
+ role: "bindable",
160
+ path: "address",
161
+ container: "property",
162
+ value_type: "text",
163
+ input_group: "address",
164
+ strength: "blocking",
165
+ fields: {
166
+ /** The address as one display line. */
167
+ display: { value_type: "text" },
168
+ /** Street line ("123 Main St"). */
169
+ street: { value_type: "text" },
170
+ /** Street number and name without the type suffix ("1112 Commonwealth"), for a short street label. */
171
+ street_no_type: { value_type: "text" },
172
+ /** City ("Springfield"). */
173
+ city: { value_type: "text" },
174
+ /** State ("IL"). */
175
+ state: { value_type: "text" },
176
+ /** Postal code ("62704"). */
177
+ postal: { value_type: "text" },
178
+ /** Apartment, suite or unit designator ("Unit 4B"), where the address carries one. */
179
+ unit: { value_type: "text" }
180
+ }
181
+ },
182
+ /** Street line of the property address ("123 Main St"). Read-only. */
183
+ address_street: {
184
+ role: "bindable",
185
+ path: "address.street",
186
+ container: "property",
187
+ value_type: "text",
188
+ input_group: "address",
189
+ strength: "blocking"
190
+ },
191
+ /** Secondary line of the property address — the apartment, suite or unit designator ("Apt 4"). Read-only. Unrelated to the `unit` container, which holds a priced listing unit. */
192
+ address_unit: {
193
+ role: "bindable",
194
+ path: "address.unit",
195
+ container: "property",
196
+ value_type: "text",
197
+ input_group: "address",
198
+ strength: "optional"
199
+ },
200
+ /** City of the property address ("Springfield"). Read-only. */
201
+ address_city: {
202
+ role: "bindable",
203
+ path: "address.city",
204
+ container: "property",
205
+ value_type: "text",
206
+ input_group: "address",
207
+ strength: "blocking"
208
+ },
209
+ /** State of the property address ("IL"). Read-only. */
210
+ address_state: {
211
+ role: "bindable",
212
+ path: "address.state",
213
+ container: "property",
214
+ value_type: "text",
215
+ input_group: "address",
216
+ strength: "blocking"
217
+ },
218
+ /** Postal code of the property address ("62704"). Read-only. */
219
+ address_postal: {
220
+ role: "bindable",
221
+ path: "address.postal",
222
+ container: "property",
223
+ value_type: "text",
224
+ input_group: "address",
225
+ strength: "blocking"
226
+ },
227
+ /** Whether the property is for sale or for rent. **Writable** — the editor offers "Update everywhere". Also supplies a `select` slot's option vocabulary. */
228
+ listing_intent: {
229
+ role: "bindable",
230
+ path: "listing_intent",
231
+ container: "property",
232
+ value_type: "text",
233
+ input_group: "intent",
234
+ strength: "blocking",
235
+ writeback: {
236
+ kind: "property",
237
+ column: "listing_intent"
238
+ }
239
+ },
240
+ /** Property type (single family, condo, multi-family, …). Read-only. */
241
+ property_type: {
242
+ role: "bindable",
243
+ path: "property_type",
244
+ container: "property",
245
+ value_type: "text",
246
+ input_group: "type",
247
+ strength: "blocking"
248
+ },
249
+ /** Property latitude, projected from the geocode. Read-only; null until the property is geocoded. Reachable as `fact.property.latitude`. */
250
+ lat: {
251
+ role: "bindable",
252
+ path: "lat",
253
+ container: "property",
254
+ value_type: "number",
255
+ input_group: "address",
256
+ strength: "blocking"
257
+ },
258
+ /** Property longitude, projected from the geocode. Read-only; null until the property is geocoded. Reachable as `fact.property.longitude`. */
259
+ lon: {
260
+ role: "bindable",
261
+ path: "lon",
262
+ container: "property",
263
+ value_type: "number",
264
+ input_group: "address",
265
+ strength: "blocking"
266
+ },
267
+ /** Unit label, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
268
+ unit_label: {
269
+ role: "bindable",
270
+ path: "units[].unit_label",
271
+ container: "unit",
272
+ value_type: "text",
273
+ input_group: "units",
274
+ strength: "optional",
275
+ writeback: {
276
+ kind: "unit",
277
+ column: "unit_label"
278
+ }
279
+ },
280
+ /** Bedroom count, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
281
+ beds: {
282
+ role: "bindable",
283
+ path: "units[].beds",
284
+ container: "unit",
285
+ value_type: "number",
286
+ input_group: "units",
287
+ strength: "blocking",
288
+ writeback: {
289
+ kind: "unit",
290
+ column: "beds"
291
+ }
292
+ },
293
+ /** Bathroom count, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
294
+ baths: {
295
+ role: "bindable",
296
+ path: "units[].baths",
297
+ container: "unit",
298
+ value_type: "number",
299
+ input_group: "units",
300
+ strength: "blocking",
301
+ writeback: {
302
+ kind: "unit",
303
+ column: "baths"
304
+ }
305
+ },
306
+ /** Interior square footage, resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
307
+ sqft: {
308
+ role: "bindable",
309
+ path: "units[].sqft",
310
+ container: "unit",
311
+ value_type: "number",
312
+ input_group: "units",
313
+ strength: "blocking",
314
+ writeback: {
315
+ kind: "unit",
316
+ column: "sqft"
317
+ }
318
+ },
319
+ /** Price as a flex value (digits or a text override such as "Sold"), resolved against the primary unit (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
320
+ price: {
321
+ role: "bindable",
322
+ path: "units[].price",
323
+ container: "unit",
324
+ value_type: "text",
325
+ input_group: "units",
326
+ strength: "blocking",
327
+ writeback: {
328
+ kind: "unit",
329
+ column: "price"
330
+ }
331
+ },
332
+ /** Every unit, baked verbatim as a record list. Read-only as a whole; the per-row fields under `fact.unit` stay writable. */
333
+ units: {
334
+ role: "bindable",
335
+ path: "units",
336
+ container: "property",
337
+ value_type: "unit_list",
338
+ input_group: "units",
339
+ strength: "blocking",
340
+ row: {
341
+ /** Durable unit identity, stable across edits — what a baked row is addressed by. */
342
+ unit_id: { value_type: "text" },
343
+ /** The unit's label, or null when the listing never asked for one. */
344
+ unit_label: { value_type: "text" },
345
+ /** Bedroom count. */
346
+ beds: { value_type: "number" },
347
+ /** Bathroom count. */
348
+ baths: { value_type: "number" },
349
+ /** Interior square footage. */
350
+ sqft: { value_type: "number" },
351
+ /** Price as a flex value — digits when numeric, the verbatim text override otherwise. */
352
+ price: { value_type: "text" },
353
+ /** Display order within the property. */
354
+ position: { value_type: "number" },
355
+ /** The floor plans assigned to this unit, in display order. */
356
+ floor_plans: {
357
+ value_type: "row_list",
358
+ row: {
359
+ /** Identity of the floor-plan image (its upload id). */
360
+ id: { value_type: "text" },
361
+ /** The floor this plan covers, where one was detected. */
362
+ floor_label: { value_type: "text" },
363
+ /** Display order within the unit. */
364
+ position: { value_type: "number" }
365
+ }
366
+ }
367
+ }
368
+ },
369
+ /** Every comparable property — recently sold or currently listed homes similar to the subject — baked verbatim as a record list, in display order. The array itself is read-only (every market number a slide shows is a `compute()` over these rows), but the members marked writable below are edited on the canvas like a unit's. */
370
+ comparables: {
371
+ role: "bindable",
372
+ path: "comparables",
373
+ container: "property",
374
+ value_type: "comparable_list",
375
+ input_group: "comparables",
376
+ strength: "blocking",
377
+ row: {
378
+ /** Durable row identity, stable across edits — what a baked row is addressed by. */
379
+ id: { value_type: "text" },
380
+ /** Street line of the comparable's address ("12 Oak St"). Part of what makes a row complete. */
381
+ address_street: {
382
+ value_type: "text",
383
+ required: true
384
+ },
385
+ /** City of the comparable's address. */
386
+ address_city: { value_type: "text" },
387
+ /** State of the comparable's address. */
388
+ address_state: { value_type: "text" },
389
+ /** Postal code of the comparable's address. */
390
+ address_postal: { value_type: "text" },
391
+ /** The comparable's address as one display line, assembled at projection. */
392
+ address: { value_type: "text" },
393
+ /** Latitude of the comparable. Part of what makes a row complete — the comps map pins on it. */
394
+ lat: {
395
+ value_type: "number",
396
+ required: true
397
+ },
398
+ /** Longitude of the comparable. Part of what makes a row complete. */
399
+ lng: {
400
+ value_type: "number",
401
+ required: true
402
+ },
403
+ /** Great-circle distance from the subject property in meters, computed at projection; null while either side lacks coordinates. */
404
+ distance_m: { value_type: "number" },
405
+ /** Where the comparable stands on the market: `"sold"` when the row carries a sale date, `"active"` when it does not. Derived rather than answered, which is why it is not a completeness member; it is what disambiguates `price`. */
406
+ status: { value_type: "text" },
407
+ /** One integer in dollars. It takes two members to read: `status` says sale price versus list price, and `price_period` says total versus monthly rent. Part of what makes a row complete. **Writable** from the canvas. */
408
+ price: {
409
+ value_type: "number",
410
+ required: true,
411
+ writeback: { column: "price" }
412
+ },
413
+ /** What `price` is denominated in: `"monthly"` on a `for_rent` property (a rent per month), `"total"` on any other listing intent. Derived at projection from the SUBJECT's listing intent rather than stored per row, and never null — print a comp's price through it or a $2,400 rent renders as a sale. */
414
+ price_period: { value_type: "text" },
415
+ /** The closing date (ISO `YYYY-MM-DD`) when sold; null otherwise. The one market fact the user answers — `status` is read off it. **Writable** from the canvas, and the write moves `status` with it. */
416
+ sale_date: {
417
+ value_type: "text",
418
+ writeback: { column: "sale_date" }
419
+ },
420
+ /** Bedroom count. **Writable** from the canvas. */
421
+ beds: {
422
+ value_type: "number",
423
+ writeback: { column: "beds" }
424
+ },
425
+ /** Bathroom count. **Writable** from the canvas. */
426
+ baths: {
427
+ value_type: "number",
428
+ writeback: { column: "baths" }
429
+ },
430
+ /** Interior square footage. **Writable** from the canvas. */
431
+ sqft: {
432
+ value_type: "number",
433
+ writeback: { column: "sqft" }
434
+ },
435
+ /** A photo of the comparable, as an absolute URL rather than an upload id — comparables are not property uploads. */
436
+ photo_url: { value_type: "text" },
437
+ /** Where the row's facts were read from — the listing's detail page. */
438
+ source_url: { value_type: "text" },
439
+ /** The name of that source ("Redfin", an MLS). */
440
+ source_name: { value_type: "text" }
441
+ }
442
+ },
443
+ /** Every contact card, baked verbatim as a record list. Read-only as a whole; the per-row fields under `fact.contact` stay writable. */
444
+ contacts: {
445
+ role: "bindable",
446
+ path: "contacts",
447
+ container: "property",
448
+ value_type: "contact_list",
449
+ input_group: "contacts",
450
+ strength: "blocking",
451
+ row: {
452
+ /** Stable identity of the contact card. */
453
+ id: { value_type: "text" },
454
+ /** Whether this is the property's primary contact — the one lead routing and the brand marks resolve from. */
455
+ primary: { value_type: "boolean" },
456
+ /** Contact name. */
457
+ name: { value_type: "text" },
458
+ /** Contact job title. */
459
+ title: { value_type: "text" },
460
+ /** The organization the contact belongs to. */
461
+ org_name: { value_type: "text" },
462
+ /** Contact biography. */
463
+ bio: { value_type: "text" },
464
+ /** Contact email address. */
465
+ email: { value_type: "text" },
466
+ /** Contact phone number. */
467
+ phone: { value_type: "text" },
468
+ /** The contact's address exactly as entered, on one line. */
469
+ address: { value_type: "text" },
470
+ /** Contact website URL. */
471
+ website_url: { value_type: "text" },
472
+ /** The contact's headshot, as an upload id rather than a URL. */
473
+ avatar_upload_id: { value_type: "text" },
474
+ /** The contact's logo for dark backgrounds, as an upload id rather than a URL. */
475
+ logo_dark_upload_id: { value_type: "text" },
476
+ /** The contact's logo for light backgrounds, as an upload id rather than a URL. */
477
+ logo_light_upload_id: { value_type: "text" },
478
+ /** Contact Instagram URL. */
479
+ instagram_url: { value_type: "text" },
480
+ /** Contact LinkedIn URL. */
481
+ linkedin_url: { value_type: "text" },
482
+ /** Contact X URL. */
483
+ x_url: { value_type: "text" },
484
+ /** Contact Facebook URL. */
485
+ facebook_url: { value_type: "text" }
486
+ }
487
+ },
488
+ /** Contact name, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
489
+ name: {
490
+ role: "bindable",
491
+ path: "contacts[].name",
492
+ container: "contact",
493
+ value_type: "text",
494
+ input_group: "contacts",
495
+ strength: "optional",
496
+ writeback: {
497
+ kind: "contact",
498
+ field: "name"
499
+ }
500
+ },
501
+ /** Contact job title, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
502
+ title: {
503
+ role: "bindable",
504
+ path: "contacts[].title",
505
+ container: "contact",
506
+ value_type: "text",
507
+ input_group: "contacts",
508
+ strength: "optional",
509
+ writeback: {
510
+ kind: "contact",
511
+ field: "title"
512
+ }
513
+ },
514
+ /** The organization the contact belongs to — the brokerage a branded deliverable paints as its wordmark. Resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
515
+ org_name: {
516
+ role: "bindable",
517
+ path: "contacts[].org_name",
518
+ container: "contact",
519
+ value_type: "text",
520
+ input_group: "contacts",
521
+ strength: "optional",
522
+ writeback: {
523
+ kind: "contact",
524
+ field: "org_name"
525
+ }
526
+ },
527
+ /** Contact biography, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
528
+ bio: {
529
+ role: "bindable",
530
+ path: "contacts[].bio",
531
+ container: "contact",
532
+ value_type: "text",
533
+ input_group: "contacts",
534
+ strength: "optional",
535
+ writeback: {
536
+ kind: "contact",
537
+ field: "bio"
538
+ }
539
+ },
540
+ /** The contact's address exactly as entered, on one line. **Writable** — the editor offers "Update everywhere". Reachable as `fact.contact.address` — the key is prefixed because this catalog is one FLAT name space shared by all three containers, and the property already owns `address`. */
541
+ contact_address: {
542
+ role: "bindable",
543
+ path: "contacts[].address",
544
+ container: "contact",
545
+ value_type: "text",
546
+ input_group: "contacts",
547
+ strength: "optional",
548
+ writeback: {
549
+ kind: "contact",
550
+ field: "address"
551
+ }
552
+ },
553
+ /** Contact email address, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
554
+ email: {
555
+ role: "bindable",
556
+ path: "contacts[].email",
557
+ container: "contact",
558
+ value_type: "text",
559
+ input_group: "contacts",
560
+ strength: "optional",
561
+ writeback: {
562
+ kind: "contact",
563
+ field: "email"
564
+ }
565
+ },
566
+ /** Contact phone number, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
567
+ phone: {
568
+ role: "bindable",
569
+ path: "contacts[].phone",
570
+ container: "contact",
571
+ value_type: "text",
572
+ input_group: "contacts",
573
+ strength: "optional",
574
+ writeback: {
575
+ kind: "contact",
576
+ field: "phone"
577
+ }
578
+ },
579
+ /** Contact website URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
580
+ website: {
581
+ role: "bindable",
582
+ path: "contacts[].website_url",
583
+ container: "contact",
584
+ value_type: "text",
585
+ input_group: "contacts",
586
+ strength: "optional",
587
+ writeback: {
588
+ kind: "contact",
589
+ field: "website"
590
+ }
591
+ },
592
+ /** Contact Instagram URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
593
+ instagram: {
594
+ role: "bindable",
595
+ path: "contacts[].instagram_url",
596
+ container: "contact",
597
+ value_type: "text",
598
+ input_group: "contacts",
599
+ strength: "optional",
600
+ writeback: {
601
+ kind: "contact",
602
+ field: "socials.instagram"
603
+ }
604
+ },
605
+ /** Contact LinkedIn URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
606
+ linkedin: {
607
+ role: "bindable",
608
+ path: "contacts[].linkedin_url",
609
+ container: "contact",
610
+ value_type: "text",
611
+ input_group: "contacts",
612
+ strength: "optional",
613
+ writeback: {
614
+ kind: "contact",
615
+ field: "socials.linkedin"
616
+ }
617
+ },
618
+ /** Contact X URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
619
+ x: {
620
+ role: "bindable",
621
+ path: "contacts[].x_url",
622
+ container: "contact",
623
+ value_type: "text",
624
+ input_group: "contacts",
625
+ strength: "optional",
626
+ writeback: {
627
+ kind: "contact",
628
+ field: "socials.x"
629
+ }
630
+ },
631
+ /** Contact Facebook URL, resolved against the primary contact card (or the current row of a record list). **Writable** — the editor offers "Update everywhere". */
632
+ facebook: {
633
+ role: "bindable",
634
+ path: "contacts[].facebook_url",
635
+ container: "contact",
636
+ value_type: "text",
637
+ input_group: "contacts",
638
+ strength: "optional",
639
+ writeback: {
640
+ kind: "contact",
641
+ field: "socials.facebook"
642
+ }
643
+ },
644
+ /** Contact headshot, resolved against the primary contact card (or the current row of a record list). Read-only; belongs on an `image` slot. */
645
+ headshot: {
646
+ role: "bindable",
647
+ path: "contacts[].avatar_upload_id",
648
+ container: "contact",
649
+ value_type: "image",
650
+ input_group: "contacts",
651
+ strength: "optional",
652
+ image: true
653
+ },
654
+ /** Contact logo for dark backgrounds, falling back to a silhouette of the light logo. Read-only; belongs on an `image` slot. */
655
+ logo_dark: {
656
+ role: "bindable",
657
+ path: "contacts[].logo_dark_upload_id",
658
+ container: "contact",
659
+ value_type: "image",
660
+ input_group: "contacts",
661
+ strength: "optional",
662
+ image: true
663
+ },
664
+ /** Contact logo for light backgrounds, falling back to a silhouette of the dark logo. Read-only; belongs on an `image` slot. */
665
+ logo_light: {
666
+ role: "bindable",
667
+ path: "contacts[].logo_light_upload_id",
668
+ container: "contact",
669
+ value_type: "image",
670
+ input_group: "contacts",
671
+ strength: "optional",
672
+ image: true
673
+ },
674
+ /** The property's always-on prose description, the substrate every text decision is grounded in. */
675
+ narrative: {
676
+ role: "readable",
677
+ path: "narrative",
678
+ value_type: "object",
679
+ input_group: "describe",
680
+ strength: "blocking",
681
+ fields: {
682
+ /** The description itself. */
683
+ description: { value_type: "text" } }
684
+ },
685
+ /** Every property photo, in candidate order. */
686
+ photos: {
687
+ role: "readable",
688
+ path: "photos",
689
+ value_type: "row_list",
690
+ input_group: "uploads",
691
+ strength: "blocking",
692
+ row: {
693
+ /** Identity of the photo. */
694
+ id: { value_type: "text" },
695
+ /** What the classifier recognized in the photo — the vocabulary image decisions rank on. */
696
+ tags: { value_type: "text_list" },
697
+ /** The photo's caption, where it has one. */
698
+ caption: { value_type: "text" }
699
+ }
700
+ },
701
+ /** Every video on the property — hosted uploads and pasted provider links alike, in the order they were added. */
702
+ videos: {
703
+ role: "readable",
704
+ path: "videos",
705
+ value_type: "row_list",
706
+ input_group: "uploads",
707
+ strength: "optional",
708
+ row: {
709
+ /** Identity of the video. */
710
+ id: { value_type: "text" },
711
+ /** Where the bytes live: `"upload"` for a rendition served directly, `"link"` for a provider embed. */
712
+ source: { value_type: "text" },
713
+ /** What the classifier recognized in the video. Always empty for a link — no classifier runs on one. */
714
+ tags: { value_type: "text_list" },
715
+ /** The video's caption; for a link, the provider's title until someone corrects it. */
716
+ caption: { value_type: "text" },
717
+ /** The provider's own description, where it publishes one. Null for an upload. */
718
+ description: { value_type: "text" },
719
+ /** Length in milliseconds. Null means UNKNOWN, never short. */
720
+ duration_ms: { value_type: "number" },
721
+ /** The pasted link, exactly as it was given. Null for an upload. */
722
+ url: { value_type: "text" },
723
+ /** Which provider hosts the link ("youtube", "vimeo"). Null for an upload. */
724
+ provider: { value_type: "text" }
725
+ }
726
+ },
727
+ /** Every 3D tour on the property, in a stable order. */
728
+ tours: {
729
+ role: "readable",
730
+ path: "tours",
731
+ value_type: "row_list",
732
+ input_group: "uploads",
733
+ strength: "optional",
734
+ row: {
735
+ /** Identity of the tour. */
736
+ id: { value_type: "text" },
737
+ /** The tour link, exactly as it was given. */
738
+ url: { value_type: "text" },
739
+ /** Which provider hosts the tour ("matterport", "biganto"). */
740
+ provider: { value_type: "text" }
741
+ }
742
+ },
743
+ /** Every floor-plan image on the property, whichever units it was assigned to. */
744
+ floor_plans: {
745
+ role: "readable",
746
+ path: "floor_plans",
747
+ value_type: "row_list",
748
+ input_group: "uploads",
749
+ strength: "optional",
750
+ row: {
751
+ /** Identity of the floor-plan image (its upload id). */
752
+ id: { value_type: "text" },
753
+ /** Which units this plan was assigned to — empty when it is building-wide. */
754
+ unit_assignments: {
755
+ value_type: "row_list",
756
+ row: {
757
+ /** The assigned unit's label. */
758
+ unit_label: { value_type: "text" },
759
+ /** The floor this plan covers for that unit. */
760
+ floor_label: { value_type: "text" },
761
+ /** Display order within that unit. */
762
+ position: { value_type: "number" }
763
+ }
764
+ }
765
+ }
766
+ },
767
+ /** Every attachable document on the property — the files a visitor opens or downloads. */
768
+ documents: {
769
+ role: "readable",
770
+ path: "documents",
771
+ value_type: "row_list",
772
+ input_group: "uploads",
773
+ strength: "optional",
774
+ row: {
775
+ /** Identity of the document. */
776
+ id: { value_type: "text" },
777
+ /** The name it was uploaded under, and the name delivery serves it as. */
778
+ filename: { value_type: "text" },
779
+ /** The file's media type — the format, which a filename may not carry. */
780
+ mime: { value_type: "text" },
781
+ /** Prose distilled out of the file, empty where there is none. */
782
+ notes: { value_type: "text" }
783
+ }
784
+ },
785
+ /** The prose distilled from uploaded documents, one entry per document — always-on grounding, where `documents` is the files themselves. */
786
+ document_notes: {
787
+ role: "readable",
788
+ path: "document_notes",
789
+ value_type: "row_list",
790
+ input_group: "uploads",
791
+ strength: "optional",
792
+ row: {
793
+ /** Which upload the notes were distilled from. */
794
+ upload_id: { value_type: "text" },
795
+ /** The distilled notes. */
796
+ notes: { value_type: "text" }
797
+ }
798
+ },
799
+ /** The primary unit — the lowest-positioned one — or null when the property has no units. */
800
+ unit: {
801
+ role: "readable",
802
+ path: "units",
803
+ value_type: "row",
804
+ primary_of: "units"
805
+ },
806
+ /** The primary contact card, or null when the property has no contacts. */
807
+ contact: {
808
+ role: "readable",
809
+ path: "contacts",
810
+ value_type: "row",
811
+ primary_of: "contacts"
812
+ },
813
+ /** The current calendar year. Ambient — read at derive time, not from any fact. */
814
+ year: {
815
+ role: "readable",
816
+ path: null,
817
+ value_type: "number",
818
+ ambient: true
819
+ }
820
+ };
821
+ /**
822
+ * Author-facing aliases over the registry's flat key space, per container —
823
+ * alias name → the registry key it projects. One table serves every derived
824
+ * fact surface (`fact.*` and the derive-time view).
825
+ */
826
+ const FACT_PROJECTIONS = {
827
+ property: {
828
+ /** Property latitude, projected from the geocode. Read-only; null until the property is geocoded. */
829
+ latitude: "lat",
830
+ /** Property longitude, projected from the geocode. Read-only; null until the property is geocoded. */
831
+ longitude: "lon"
832
+ },
833
+ contact: {
834
+ /** The primary contact's address exactly as entered, on one line. **Writable** — the editor offers "Update everywhere". */
835
+ address: "contact_address" }
836
+ };
837
+ function projectBindableFacts(graph) {
838
+ const projected = {};
839
+ for (const [name, entry] of Object.entries(graph)) {
840
+ if (entry.role !== "bindable") continue;
841
+ const descriptor = {
842
+ container: entry.container,
843
+ value_type: entry.value_type
844
+ };
845
+ if (entry.image === true) descriptor.image = true;
846
+ if (entry.writeback !== void 0) descriptor.writeback = entry.writeback;
847
+ projected[name] = descriptor;
848
+ }
849
+ return projected;
850
+ }
851
+ /**
852
+ * The catalog of every canonical field a slot's `direct` source may bind to — property, unit, and contact scalars, plus the read-only array sources (`units`, `contacts`).
853
+ *
854
+ * @remarks
855
+ * Not a list of its own: it is exactly the bindable half of the property fact
856
+ * graph, stripped to the descriptor a resolver and the editor read. Each entry
857
+ * declares its container, value type, and (if writable) writeback target, and
858
+ * carries its doc sentence through to `fact.*` — where the fact namespace
859
+ * reference lists every binding this yields, with that prose.
860
+ * Computed/aggregated values are never here — a section authors those with
861
+ * `compute()`.
862
+ */
863
+ const SOURCE_FIELDS = /* @__PURE__ */ projectBindableFacts(FACT_GRAPH);
864
+ /** Whether the catalog entry named `field` is writable (carries a `writeback` target). */
865
+ function isWritableSourceField(field) {
866
+ return SOURCE_FIELDS[field]?.writeback !== void 0;
867
+ }
868
+ /**
869
+ * The named dynamic option sources a `select` slot's `options.source` may name — the fields whose own domain IS the slot's option vocabulary.
870
+ *
871
+ * @remarks
872
+ * A `select({ source: fact.* })` emits `options.source` from its binding, so
873
+ * every member is necessarily a `SOURCE_FIELDS` key (the `satisfies` below is
874
+ * what holds that). Not every source field earns a member: only one whose value
875
+ * space is a small closed set an editor can offer as a dropdown. An unlisted
876
+ * source resolves to an EMPTY dropdown at runtime rather than an error, which
877
+ * is why `assertOptionSourceContract` checks it at authoring time. The provider
878
+ * functions that turn each member into concrete options live in the editor
879
+ * layer (`@homepages/slot-editors`); the vocabulary is here so the validators
880
+ * can read it without depending on React.
881
+ */
882
+ const OPTION_SOURCES = ["listing_intent"];
883
+ /** Whether `value` names a real dynamic option source. */
884
+ function isOptionSource(value) {
885
+ return OPTION_SOURCES.includes(value);
886
+ }
887
+ /**
888
+ * The registry of fact array fields a slot may be collection-bound to (a slot is collection-bound iff `source.kind === "direct"` and `source.field` is a key here).
889
+ *
890
+ * @remarks
891
+ * The single home for per-kind mechanics; other layers implement their
892
+ * operations keyed by these entries rather than restating them. `idKey`
893
+ * names the stable canonical row id (used for merge, markers, and editor
894
+ * identity). `cap`/`min`, when present, are the API-enforced membership
895
+ * ceiling/floor. `ownership` is the property-owned vs. library-shared
896
+ * discriminator that gates writeback/fan-out strategy per layer — never a
897
+ * shared physical table.
898
+ */
899
+ const COLLECTIONS = {
900
+ units: {
901
+ idKey: "unit_id",
902
+ ownership: "property"
903
+ },
904
+ contacts: {
905
+ idKey: "id",
906
+ cap: 12,
907
+ min: 1,
908
+ ownership: "library"
909
+ },
910
+ comparables: {
911
+ idKey: "id",
912
+ ownership: "property"
913
+ }
914
+ };
915
+ /**
916
+ * Which `COLLECTIONS` entry, if any, a slot definition is bound to.
917
+ *
918
+ * Keys on the SOURCE alone — no slot-type literal involved: a slot is
919
+ * collection-bound iff its `source` is `direct` and names a `COLLECTIONS`
920
+ * field. That a bound slot's item must be a record (a `list` carrying
921
+ * `fields`) is the authoring gate's business (`@homepages/section-contracts`),
922
+ * not this key.
923
+ *
924
+ * @returns The collection field name, or `null` when the slot's source is not
925
+ * `kind:"direct"` or names a field outside `COLLECTIONS`.
926
+ */
927
+ function collectionForSlot(slot) {
928
+ if (slot.source?.kind !== "direct") return null;
929
+ const field = slot.source.field;
930
+ return field !== void 0 && Object.hasOwn(COLLECTIONS, field) ? field : null;
931
+ }
932
+ /**
933
+ * The membership bounds a collection-bound list inherits — the registry
934
+ * entry's `min` floor and its `cap` ceiling, spelled as the slot's `min`/`max`.
935
+ *
936
+ * @returns Only the bounds the entry actually declares; `units` declares neither.
937
+ */
938
+ function collectionBounds(field) {
939
+ const entry = COLLECTIONS[field];
940
+ return {
941
+ ...entry.min !== void 0 ? { min: entry.min } : {},
942
+ ...entry.cap !== void 0 ? { max: entry.cap } : {}
943
+ };
944
+ }
945
+ /**
946
+ * Resolves every collection-bound list in `slots` to a concrete `min`/`max`,
947
+ * in place: an omitted bound takes the registry's value, an authored (narrower) one
948
+ * stands. Serialized schemas therefore always carry a number, so the editor and the
949
+ * API enforce the same one instead of each reading its own declaration.
950
+ *
951
+ * @remarks
952
+ * Runs at materialization, AFTER validation — `assertRecordCollectionContract`
953
+ * decides legality from what the author wrote, and a stamped slot no longer says.
954
+ */
955
+ function stampCollectionBounds(slots) {
956
+ for (const slot of Object.values(slots)) {
957
+ const collection = collectionForSlot(slot);
958
+ if (collection === null) continue;
959
+ const inherited = collectionBounds(collection);
960
+ if (slot.min === void 0 && inherited.min !== void 0) slot.min = inherited.min;
961
+ if (slot.max === void 0 && inherited.max !== void 0) slot.max = inherited.max;
962
+ }
963
+ }
964
+ /**
965
+ * The entries a section's `display` block may declare, in the order a batched
966
+ * `display-select` resolves them. The one axis rule is the block's shape, not a
967
+ * value here: `variant` is singular.
968
+ */
969
+ const DISPLAY_ENTRIES = ["visibility", "variant"];
970
+ /**
971
+ * The pinned vocabulary of a `display.visibility` entry — an author declares
972
+ * exactly these two cases, in either order, and the order states the failure
973
+ * posture (first case wins when the decision or the compute fails). A variant's
974
+ * cases are the author's own; visibility's are not, because storage maps them
975
+ * onto the existing instance `enabled` boolean.
976
+ */
977
+ const VISIBILITY_CASES = ["visible", "hidden"];
978
+ /**
979
+ * The single source of truth for "what kind of link is this URL". A `url`
980
+ * slot names one of these — or a single provider id — in its `accepts`
981
+ * field; `acceptsLink()` enforces it.
982
+ */
983
+ const LINK_KINDS = [
984
+ "tour",
985
+ "video",
986
+ "social",
987
+ "listing",
988
+ "file",
989
+ "map"
990
+ ];
991
+ /**
992
+ * The catalog of recognized link providers, keyed by provider id. Each
993
+ * entry's `pattern` (and optional `path`) classifies a pasted URL;
994
+ * `matchLinkProvider` walks this catalog in declaration order.
995
+ */
996
+ const LINK_PROVIDERS = {
997
+ matterport: {
998
+ kind: "tour",
999
+ label: "Matterport",
1000
+ pattern: /(^|\.)matterport\.com$/i,
1001
+ strategy: "api"
1002
+ },
1003
+ biganto: {
1004
+ kind: "tour",
1005
+ label: "Biganto",
1006
+ pattern: /(^|\.)biganto\.com$/i,
1007
+ strategy: "opengraph"
1008
+ },
1009
+ youtube: {
1010
+ kind: "video",
1011
+ label: "YouTube",
1012
+ pattern: /(^|\.)(youtube\.com|youtu\.be)$/i,
1013
+ strategy: "oembed"
1014
+ },
1015
+ vimeo: {
1016
+ kind: "video",
1017
+ label: "Vimeo",
1018
+ pattern: /(^|\.)vimeo\.com$/i,
1019
+ strategy: "oembed"
1020
+ },
1021
+ zillow: {
1022
+ kind: "listing",
1023
+ label: "Zillow",
1024
+ pattern: /(^|\.)zillow\.com$/i,
1025
+ strategy: "none"
1026
+ },
1027
+ redfin: {
1028
+ kind: "listing",
1029
+ label: "Redfin",
1030
+ pattern: /(^|\.)redfin\.com$/i,
1031
+ strategy: "none"
1032
+ },
1033
+ dropbox: {
1034
+ kind: "file",
1035
+ label: "Dropbox",
1036
+ pattern: /(^|\.)dropbox\.com$/i,
1037
+ strategy: "none"
1038
+ },
1039
+ drive: {
1040
+ kind: "file",
1041
+ label: "Google Drive",
1042
+ pattern: /^drive\.google\.com$/i,
1043
+ strategy: "none"
1044
+ },
1045
+ maps: {
1046
+ kind: "map",
1047
+ label: "Google Maps",
1048
+ pattern: /(^|\.)google\.com$/i,
1049
+ path: /^\/maps(\/|$)/i,
1050
+ strategy: "none"
1051
+ }
1052
+ };
1053
+ /**
1054
+ * Classify a pasted URL against `LINK_PROVIDERS`.
1055
+ *
1056
+ * @returns `null` for an unparseable value, a scheme-less value (callers
1057
+ * must normalize a bare host by prepending `https://` before calling), or a
1058
+ * host matching no provider. Otherwise the FIRST match in `LINK_PROVIDERS`
1059
+ * declaration order — load-bearing, since `drive.google.com` matches both
1060
+ * `drive`'s own pattern and `maps`'s `google.com` pattern, and only
1061
+ * `drive`'s earlier declaration makes it resolve to `drive` rather than
1062
+ * `maps`.
1063
+ */
1064
+ function matchLinkProvider(url) {
1065
+ let parsed;
1066
+ try {
1067
+ parsed = new URL(url);
1068
+ } catch {
1069
+ return null;
1070
+ }
1071
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
1072
+ for (const [id, provider] of Object.entries(LINK_PROVIDERS)) {
1073
+ if (!provider.pattern.test(parsed.hostname)) continue;
1074
+ if (provider.path && !provider.path.test(parsed.pathname)) continue;
1075
+ return id;
1076
+ }
1077
+ return null;
1078
+ }
1079
+ /** True iff `value` names a LINK_KINDS member or a LINK_PROVIDERS key. */
1080
+ function isLinkAccepts(value) {
1081
+ return LINK_KINDS.includes(value) || Object.prototype.hasOwnProperty.call(LINK_PROVIDERS, value);
1082
+ }
1083
+ /**
1084
+ * Does `url` satisfy an `accepts` token — a `LinkKind` or a single `LinkProviderId`?
1085
+ *
1086
+ * @param accepts A `url` slot's `accepts` value. An unrecognized token
1087
+ * always yields `false`: a typo must fail closed, never accept everything.
1088
+ * @remarks Callers handle the empty-value case themselves — an empty `url`
1089
+ * slot is legal regardless of `accepts` (clearing a slot is not a validity
1090
+ * question).
1091
+ */
1092
+ function acceptsLink(accepts, url) {
1093
+ const id = matchLinkProvider(url);
1094
+ if (id === null) return false;
1095
+ if (id === accepts) return true;
1096
+ return LINK_KINDS.includes(accepts) && LINK_PROVIDERS[id].kind === accepts;
1097
+ }
1098
+ /**
1099
+ * Where a video's bytes live: `"upload"` is a transcoded rendition served directly; `"link"` is a provider embed whose bytes are never served locally.
1100
+ *
1101
+ * @remarks
1102
+ * Deliberately not spelled like `LinkStrategy` (`"oembed"` | `"api"` |
1103
+ * `"opengraph"` | `"none"`), which means HOW a provider's metadata was
1104
+ * obtained, an orthogonal concern.
1105
+ */
1106
+ const VIDEO_SOURCES = ["upload", "link"];
1107
+
1108
+ //#endregion
1109
+ export { COLLECTIONS, COLLECTION_SLOT_TYPES, CONTENT_SLOT_TYPES, DISPLAY_ENTRIES, FACT_GRAPH, FACT_PROJECTIONS, INPUT_GROUPS, INPUT_GROUP_REQUIREMENT, LINK_KINDS, LINK_PROVIDERS, OPTION_SOURCES, REFERRAL_FIELDS, REFERRAL_IMAGE_FIELDS, REF_SLOT_TYPES, SLOT_TYPES, SOURCE_FIELDS, SOURCE_FILTERS, VIDEO_SOURCES, VISIBILITY_CASES, acceptsLink, collectionBounds, collectionForSlot, isCollectionSlotType, isLinkAccepts, isOptionSource, isSourceFilter, isWritableSourceField, matchLinkProvider, stampCollectionBounds };