@aglyn/aglyn 1.0.0-beta.143

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 (963) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +11 -0
  3. package/package.json +66 -0
  4. package/src/index.d.ts +25 -0
  5. package/src/index.js +26 -0
  6. package/src/index.js.map +1 -0
  7. package/src/lib/aglyn.d.ts +31 -0
  8. package/src/lib/aglyn.js +114 -0
  9. package/src/lib/aglyn.js.map +1 -0
  10. package/src/lib/app-utils/abuse-report.d.ts +193 -0
  11. package/src/lib/app-utils/abuse-report.js +321 -0
  12. package/src/lib/app-utils/abuse-report.js.map +1 -0
  13. package/src/lib/app-utils/accept-negotiation.d.ts +129 -0
  14. package/src/lib/app-utils/accept-negotiation.js +266 -0
  15. package/src/lib/app-utils/accept-negotiation.js.map +1 -0
  16. package/src/lib/app-utils/account-emails.d.ts +263 -0
  17. package/src/lib/app-utils/account-emails.js +264 -0
  18. package/src/lib/app-utils/account-emails.js.map +1 -0
  19. package/src/lib/app-utils/actions.d.ts +717 -0
  20. package/src/lib/app-utils/actions.js +1031 -0
  21. package/src/lib/app-utils/actions.js.map +1 -0
  22. package/src/lib/app-utils/activity-presenter.d.ts +152 -0
  23. package/src/lib/app-utils/activity-presenter.js +326 -0
  24. package/src/lib/app-utils/activity-presenter.js.map +1 -0
  25. package/src/lib/app-utils/advertising-tag-mounts.d.ts +133 -0
  26. package/src/lib/app-utils/advertising-tag-mounts.js +118 -0
  27. package/src/lib/app-utils/advertising-tag-mounts.js.map +1 -0
  28. package/src/lib/app-utils/advertising-tags.d.ts +307 -0
  29. package/src/lib/app-utils/advertising-tags.js +525 -0
  30. package/src/lib/app-utils/advertising-tags.js.map +1 -0
  31. package/src/lib/app-utils/agent-api-catalog.d.ts +94 -0
  32. package/src/lib/app-utils/agent-api-catalog.js +106 -0
  33. package/src/lib/app-utils/agent-api-catalog.js.map +1 -0
  34. package/src/lib/app-utils/agent-openapi.d.ts +103 -0
  35. package/src/lib/app-utils/agent-openapi.js +1128 -0
  36. package/src/lib/app-utils/agent-openapi.js.map +1 -0
  37. package/src/lib/app-utils/analytics-beacon.d.ts +154 -0
  38. package/src/lib/app-utils/analytics-beacon.js +152 -0
  39. package/src/lib/app-utils/analytics-beacon.js.map +1 -0
  40. package/src/lib/app-utils/analytics-environment.d.ts +133 -0
  41. package/src/lib/app-utils/analytics-environment.js +152 -0
  42. package/src/lib/app-utils/analytics-environment.js.map +1 -0
  43. package/src/lib/app-utils/analytics-events.d.ts +744 -0
  44. package/src/lib/app-utils/analytics-events.js +650 -0
  45. package/src/lib/app-utils/analytics-events.js.map +1 -0
  46. package/src/lib/app-utils/analytics-link-clicks.d.ts +102 -0
  47. package/src/lib/app-utils/analytics-link-clicks.js +267 -0
  48. package/src/lib/app-utils/analytics-link-clicks.js.map +1 -0
  49. package/src/lib/app-utils/analytics-path-key.d.ts +46 -0
  50. package/src/lib/app-utils/analytics-path-key.js +46 -0
  51. package/src/lib/app-utils/analytics-path-key.js.map +1 -0
  52. package/src/lib/app-utils/api-adapter.d.ts +47 -0
  53. package/src/lib/app-utils/api-adapter.js +367 -0
  54. package/src/lib/app-utils/api-adapter.js.map +1 -0
  55. package/src/lib/app-utils/api-idempotency.d.ts +169 -0
  56. package/src/lib/app-utils/api-idempotency.js +213 -0
  57. package/src/lib/app-utils/api-idempotency.js.map +1 -0
  58. package/src/lib/app-utils/api-plugins.d.ts +210 -0
  59. package/src/lib/app-utils/api-plugins.js +221 -0
  60. package/src/lib/app-utils/api-plugins.js.map +1 -0
  61. package/src/lib/app-utils/assist-credits.d.ts +482 -0
  62. package/src/lib/app-utils/assist-credits.js +509 -0
  63. package/src/lib/app-utils/assist-credits.js.map +1 -0
  64. package/src/lib/app-utils/attribution-attribute.d.ts +34 -0
  65. package/src/lib/app-utils/attribution-attribute.js +34 -0
  66. package/src/lib/app-utils/attribution-attribute.js.map +1 -0
  67. package/src/lib/app-utils/attribution-guard.d.ts +130 -0
  68. package/src/lib/app-utils/attribution-guard.js +410 -0
  69. package/src/lib/app-utils/attribution-guard.js.map +1 -0
  70. package/src/lib/app-utils/author-css.d.ts +123 -0
  71. package/src/lib/app-utils/author-css.js +275 -0
  72. package/src/lib/app-utils/author-css.js.map +1 -0
  73. package/src/lib/app-utils/author-html-markdown.d.ts +31 -0
  74. package/src/lib/app-utils/author-html-markdown.js +497 -0
  75. package/src/lib/app-utils/author-html-markdown.js.map +1 -0
  76. package/src/lib/app-utils/author-html.d.ts +135 -0
  77. package/src/lib/app-utils/author-html.js +1037 -0
  78. package/src/lib/app-utils/author-html.js.map +1 -0
  79. package/src/lib/app-utils/automation-placeholders.d.ts +72 -0
  80. package/src/lib/app-utils/automation-placeholders.js +207 -0
  81. package/src/lib/app-utils/automation-placeholders.js.map +1 -0
  82. package/src/lib/app-utils/bandwidth-cap.d.ts +183 -0
  83. package/src/lib/app-utils/bandwidth-cap.js +193 -0
  84. package/src/lib/app-utils/bandwidth-cap.js.map +1 -0
  85. package/src/lib/app-utils/binding-token-catalog.d.ts +82 -0
  86. package/src/lib/app-utils/binding-token-catalog.js +293 -0
  87. package/src/lib/app-utils/binding-token-catalog.js.map +1 -0
  88. package/src/lib/app-utils/binding-tokens.d.ts +157 -0
  89. package/src/lib/app-utils/binding-tokens.js +251 -0
  90. package/src/lib/app-utils/binding-tokens.js.map +1 -0
  91. package/src/lib/app-utils/breadcrumb-json-ld.d.ts +57 -0
  92. package/src/lib/app-utils/breadcrumb-json-ld.js +67 -0
  93. package/src/lib/app-utils/breadcrumb-json-ld.js.map +1 -0
  94. package/src/lib/app-utils/campaign-attribution.d.ts +117 -0
  95. package/src/lib/app-utils/campaign-attribution.js +162 -0
  96. package/src/lib/app-utils/campaign-attribution.js.map +1 -0
  97. package/src/lib/app-utils/campaign-forwarding.d.ts +220 -0
  98. package/src/lib/app-utils/campaign-forwarding.js +332 -0
  99. package/src/lib/app-utils/campaign-forwarding.js.map +1 -0
  100. package/src/lib/app-utils/campaign-membership.d.ts +109 -0
  101. package/src/lib/app-utils/campaign-membership.js +176 -0
  102. package/src/lib/app-utils/campaign-membership.js.map +1 -0
  103. package/src/lib/app-utils/campaign-touch.d.ts +206 -0
  104. package/src/lib/app-utils/campaign-touch.js +326 -0
  105. package/src/lib/app-utils/campaign-touch.js.map +1 -0
  106. package/src/lib/app-utils/child-contract-compose.d.ts +28 -0
  107. package/src/lib/app-utils/child-contract-compose.js +140 -0
  108. package/src/lib/app-utils/child-contract-compose.js.map +1 -0
  109. package/src/lib/app-utils/child-contract.d.ts +129 -0
  110. package/src/lib/app-utils/child-contract.js +153 -0
  111. package/src/lib/app-utils/child-contract.js.map +1 -0
  112. package/src/lib/app-utils/collection-delete.d.ts +113 -0
  113. package/src/lib/app-utils/collection-delete.js +120 -0
  114. package/src/lib/app-utils/collection-delete.js.map +1 -0
  115. package/src/lib/app-utils/collection-entries.d.ts +833 -0
  116. package/src/lib/app-utils/collection-entries.js +1285 -0
  117. package/src/lib/app-utils/collection-entries.js.map +1 -0
  118. package/src/lib/app-utils/collection-entry-date.d.ts +129 -0
  119. package/src/lib/app-utils/collection-entry-date.js +183 -0
  120. package/src/lib/app-utils/collection-entry-date.js.map +1 -0
  121. package/src/lib/app-utils/collection-kind.d.ts +55 -0
  122. package/src/lib/app-utils/collection-kind.js +69 -0
  123. package/src/lib/app-utils/collection-kind.js.map +1 -0
  124. package/src/lib/app-utils/collection-slug.d.ts +79 -0
  125. package/src/lib/app-utils/collection-slug.js +70 -0
  126. package/src/lib/app-utils/collection-slug.js.map +1 -0
  127. package/src/lib/app-utils/compose-layout-nodes.d.ts +147 -0
  128. package/src/lib/app-utils/compose-layout-nodes.js +261 -0
  129. package/src/lib/app-utils/compose-layout-nodes.js.map +1 -0
  130. package/src/lib/app-utils/compose-layout-props.d.ts +71 -0
  131. package/src/lib/app-utils/compose-layout-props.js +61 -0
  132. package/src/lib/app-utils/compose-layout-props.js.map +1 -0
  133. package/src/lib/app-utils/compose-reusable-components.d.ts +504 -0
  134. package/src/lib/app-utils/compose-reusable-components.js +1366 -0
  135. package/src/lib/app-utils/compose-reusable-components.js.map +1 -0
  136. package/src/lib/app-utils/compress.d.ts +35 -0
  137. package/src/lib/app-utils/compress.js +38 -0
  138. package/src/lib/app-utils/compress.js.map +1 -0
  139. package/src/lib/app-utils/consent-banner-ui.d.ts +226 -0
  140. package/src/lib/app-utils/consent-banner-ui.js +583 -0
  141. package/src/lib/app-utils/consent-banner-ui.js.map +1 -0
  142. package/src/lib/app-utils/consent-groups.d.ts +189 -0
  143. package/src/lib/app-utils/consent-groups.js +219 -0
  144. package/src/lib/app-utils/consent-groups.js.map +1 -0
  145. package/src/lib/app-utils/consent-preferences-dialog.d.ts +58 -0
  146. package/src/lib/app-utils/consent-preferences-dialog.js +106 -0
  147. package/src/lib/app-utils/consent-preferences-dialog.js.map +1 -0
  148. package/src/lib/app-utils/console-record-links.d.ts +163 -0
  149. package/src/lib/app-utils/console-record-links.js +178 -0
  150. package/src/lib/app-utils/console-record-links.js.map +1 -0
  151. package/src/lib/app-utils/console-routes.d.ts +658 -0
  152. package/src/lib/app-utils/console-routes.js +489 -0
  153. package/src/lib/app-utils/console-routes.js.map +1 -0
  154. package/src/lib/app-utils/console-widget-slot-context.d.ts +46 -0
  155. package/src/lib/app-utils/console-widget-slot-context.js +23 -0
  156. package/src/lib/app-utils/console-widget-slot-context.js.map +1 -0
  157. package/src/lib/app-utils/contact-custom-fields.d.ts +191 -0
  158. package/src/lib/app-utils/contact-custom-fields.js +349 -0
  159. package/src/lib/app-utils/contact-custom-fields.js.map +1 -0
  160. package/src/lib/app-utils/contact-holder.d.ts +52 -0
  161. package/src/lib/app-utils/contact-holder.js +98 -0
  162. package/src/lib/app-utils/contact-holder.js.map +1 -0
  163. package/src/lib/app-utils/contact-merge.d.ts +136 -0
  164. package/src/lib/app-utils/contact-merge.js +379 -0
  165. package/src/lib/app-utils/contact-merge.js.map +1 -0
  166. package/src/lib/app-utils/contacts.d.ts +554 -0
  167. package/src/lib/app-utils/contacts.js +401 -0
  168. package/src/lib/app-utils/contacts.js.map +1 -0
  169. package/src/lib/app-utils/content-author-profile.d.ts +68 -0
  170. package/src/lib/app-utils/content-author-profile.js +118 -0
  171. package/src/lib/app-utils/content-author-profile.js.map +1 -0
  172. package/src/lib/app-utils/content-authors.d.ts +662 -0
  173. package/src/lib/app-utils/content-authors.js +771 -0
  174. package/src/lib/app-utils/content-authors.js.map +1 -0
  175. package/src/lib/app-utils/content-schema-type.d.ts +81 -0
  176. package/src/lib/app-utils/content-schema-type.js +87 -0
  177. package/src/lib/app-utils/content-schema-type.js.map +1 -0
  178. package/src/lib/app-utils/contexts.d.ts +35 -0
  179. package/src/lib/app-utils/contexts.js +35 -0
  180. package/src/lib/app-utils/contexts.js.map +1 -0
  181. package/src/lib/app-utils/create-resource-uid.d.ts +18 -0
  182. package/src/lib/app-utils/create-resource-uid.js +23 -0
  183. package/src/lib/app-utils/create-resource-uid.js.map +1 -0
  184. package/src/lib/app-utils/crm-booking.d.ts +75 -0
  185. package/src/lib/app-utils/crm-booking.js +133 -0
  186. package/src/lib/app-utils/crm-booking.js.map +1 -0
  187. package/src/lib/app-utils/crm-csv.d.ts +232 -0
  188. package/src/lib/app-utils/crm-csv.js +432 -0
  189. package/src/lib/app-utils/crm-csv.js.map +1 -0
  190. package/src/lib/app-utils/crm-digest.d.ts +179 -0
  191. package/src/lib/app-utils/crm-digest.js +271 -0
  192. package/src/lib/app-utils/crm-digest.js.map +1 -0
  193. package/src/lib/app-utils/crm-email-templates.d.ts +172 -0
  194. package/src/lib/app-utils/crm-email-templates.js +382 -0
  195. package/src/lib/app-utils/crm-email-templates.js.map +1 -0
  196. package/src/lib/app-utils/crm-inbound.d.ts +245 -0
  197. package/src/lib/app-utils/crm-inbound.js +407 -0
  198. package/src/lib/app-utils/crm-inbound.js.map +1 -0
  199. package/src/lib/app-utils/crm-kinds.d.ts +73 -0
  200. package/src/lib/app-utils/crm-kinds.js +92 -0
  201. package/src/lib/app-utils/crm-kinds.js.map +1 -0
  202. package/src/lib/app-utils/crm-next-activity.d.ts +107 -0
  203. package/src/lib/app-utils/crm-next-activity.js +140 -0
  204. package/src/lib/app-utils/crm-next-activity.js.map +1 -0
  205. package/src/lib/app-utils/crm-reports.d.ts +479 -0
  206. package/src/lib/app-utils/crm-reports.js +680 -0
  207. package/src/lib/app-utils/crm-reports.js.map +1 -0
  208. package/src/lib/app-utils/crm-task-reminders.d.ts +129 -0
  209. package/src/lib/app-utils/crm-task-reminders.js +139 -0
  210. package/src/lib/app-utils/crm-task-reminders.js.map +1 -0
  211. package/src/lib/app-utils/crm.d.ts +1546 -0
  212. package/src/lib/app-utils/crm.js +1814 -0
  213. package/src/lib/app-utils/crm.js.map +1 -0
  214. package/src/lib/app-utils/csp-report.d.ts +84 -0
  215. package/src/lib/app-utils/csp-report.js +177 -0
  216. package/src/lib/app-utils/csp-report.js.map +1 -0
  217. package/src/lib/app-utils/csv-import.d.ts +192 -0
  218. package/src/lib/app-utils/csv-import.js +279 -0
  219. package/src/lib/app-utils/csv-import.js.map +1 -0
  220. package/src/lib/app-utils/dataset-csv.d.ts +109 -0
  221. package/src/lib/app-utils/dataset-csv.js +235 -0
  222. package/src/lib/app-utils/dataset-csv.js.map +1 -0
  223. package/src/lib/app-utils/dataset-models.d.ts +194 -0
  224. package/src/lib/app-utils/dataset-models.js +409 -0
  225. package/src/lib/app-utils/dataset-models.js.map +1 -0
  226. package/src/lib/app-utils/dataset-query.d.ts +57 -0
  227. package/src/lib/app-utils/dataset-query.js +126 -0
  228. package/src/lib/app-utils/dataset-query.js.map +1 -0
  229. package/src/lib/app-utils/datasets.d.ts +136 -0
  230. package/src/lib/app-utils/datasets.js +177 -0
  231. package/src/lib/app-utils/datasets.js.map +1 -0
  232. package/src/lib/app-utils/decompress.d.ts +36 -0
  233. package/src/lib/app-utils/decompress.js +32 -0
  234. package/src/lib/app-utils/decompress.js.map +1 -0
  235. package/src/lib/app-utils/dedicated-sending-domain.d.ts +47 -0
  236. package/src/lib/app-utils/dedicated-sending-domain.js +114 -0
  237. package/src/lib/app-utils/dedicated-sending-domain.js.map +1 -0
  238. package/src/lib/app-utils/deferred-image.d.ts +86 -0
  239. package/src/lib/app-utils/deferred-image.js +83 -0
  240. package/src/lib/app-utils/deferred-image.js.map +1 -0
  241. package/src/lib/app-utils/definition-canvas-tree.d.ts +61 -0
  242. package/src/lib/app-utils/definition-canvas-tree.js +126 -0
  243. package/src/lib/app-utils/definition-canvas-tree.js.map +1 -0
  244. package/src/lib/app-utils/deployment-shape.d.ts +167 -0
  245. package/src/lib/app-utils/deployment-shape.js +238 -0
  246. package/src/lib/app-utils/deployment-shape.js.map +1 -0
  247. package/src/lib/app-utils/detect-template-placeholders.d.ts +30 -0
  248. package/src/lib/app-utils/detect-template-placeholders.js +53 -0
  249. package/src/lib/app-utils/detect-template-placeholders.js.map +1 -0
  250. package/src/lib/app-utils/dmca-counter-notice.d.ts +185 -0
  251. package/src/lib/app-utils/dmca-counter-notice.js +277 -0
  252. package/src/lib/app-utils/dmca-counter-notice.js.map +1 -0
  253. package/src/lib/app-utils/docs-deflection.d.ts +156 -0
  254. package/src/lib/app-utils/docs-deflection.js +547 -0
  255. package/src/lib/app-utils/docs-deflection.js.map +1 -0
  256. package/src/lib/app-utils/docs-help.d.ts +57 -0
  257. package/src/lib/app-utils/docs-help.generated.d.ts +303 -0
  258. package/src/lib/app-utils/docs-help.generated.js +867 -0
  259. package/src/lib/app-utils/docs-help.generated.js.map +1 -0
  260. package/src/lib/app-utils/docs-help.js +46 -0
  261. package/src/lib/app-utils/docs-help.js.map +1 -0
  262. package/src/lib/app-utils/docs-index.generated.d.ts +29 -0
  263. package/src/lib/app-utils/docs-index.generated.js +8388 -0
  264. package/src/lib/app-utils/docs-index.generated.js.map +1 -0
  265. package/src/lib/app-utils/docs-retrieval.d.ts +67 -0
  266. package/src/lib/app-utils/docs-retrieval.js +188 -0
  267. package/src/lib/app-utils/docs-retrieval.js.map +1 -0
  268. package/src/lib/app-utils/document-landmark.d.ts +50 -0
  269. package/src/lib/app-utils/document-landmark.js +100 -0
  270. package/src/lib/app-utils/document-landmark.js.map +1 -0
  271. package/src/lib/app-utils/duplicate-resource.d.ts +101 -0
  272. package/src/lib/app-utils/duplicate-resource.js +206 -0
  273. package/src/lib/app-utils/duplicate-resource.js.map +1 -0
  274. package/src/lib/app-utils/dynamic-list-rule.d.ts +471 -0
  275. package/src/lib/app-utils/dynamic-list-rule.js +914 -0
  276. package/src/lib/app-utils/dynamic-list-rule.js.map +1 -0
  277. package/src/lib/app-utils/element-animation.d.ts +200 -0
  278. package/src/lib/app-utils/element-animation.js +233 -0
  279. package/src/lib/app-utils/element-animation.js.map +1 -0
  280. package/src/lib/app-utils/element-hidden-style.d.ts +46 -0
  281. package/src/lib/app-utils/element-hidden-style.js +48 -0
  282. package/src/lib/app-utils/element-hidden-style.js.map +1 -0
  283. package/src/lib/app-utils/element-ui.d.ts +243 -0
  284. package/src/lib/app-utils/element-ui.js +459 -0
  285. package/src/lib/app-utils/element-ui.js.map +1 -0
  286. package/src/lib/app-utils/email-starter-policy.d.ts +160 -0
  287. package/src/lib/app-utils/email-starter-policy.js +327 -0
  288. package/src/lib/app-utils/email-starter-policy.js.map +1 -0
  289. package/src/lib/app-utils/email-topics.d.ts +310 -0
  290. package/src/lib/app-utils/email-topics.js +336 -0
  291. package/src/lib/app-utils/email-topics.js.map +1 -0
  292. package/src/lib/app-utils/enabled-plugins-context.d.ts +100 -0
  293. package/src/lib/app-utils/enabled-plugins-context.js +113 -0
  294. package/src/lib/app-utils/enabled-plugins-context.js.map +1 -0
  295. package/src/lib/app-utils/ensure-canvas-root.d.ts +38 -0
  296. package/src/lib/app-utils/ensure-canvas-root.js +61 -0
  297. package/src/lib/app-utils/ensure-canvas-root.js.map +1 -0
  298. package/src/lib/app-utils/entity-picker-context.d.ts +199 -0
  299. package/src/lib/app-utils/entity-picker-context.js +93 -0
  300. package/src/lib/app-utils/entity-picker-context.js.map +1 -0
  301. package/src/lib/app-utils/error-beacon.d.ts +107 -0
  302. package/src/lib/app-utils/error-beacon.js +296 -0
  303. package/src/lib/app-utils/error-beacon.js.map +1 -0
  304. package/src/lib/app-utils/expand-repeatables.d.ts +172 -0
  305. package/src/lib/app-utils/expand-repeatables.js +299 -0
  306. package/src/lib/app-utils/expand-repeatables.js.map +1 -0
  307. package/src/lib/app-utils/foreign-script.d.ts +82 -0
  308. package/src/lib/app-utils/foreign-script.js +102 -0
  309. package/src/lib/app-utils/foreign-script.js.map +1 -0
  310. package/src/lib/app-utils/form-abuse-ceiling.d.ts +146 -0
  311. package/src/lib/app-utils/form-abuse-ceiling.js +158 -0
  312. package/src/lib/app-utils/form-abuse-ceiling.js.map +1 -0
  313. package/src/lib/app-utils/form-contract.d.ts +198 -0
  314. package/src/lib/app-utils/form-contract.js +282 -0
  315. package/src/lib/app-utils/form-contract.js.map +1 -0
  316. package/src/lib/app-utils/form-dataset-binding.d.ts +50 -0
  317. package/src/lib/app-utils/form-dataset-binding.js +74 -0
  318. package/src/lib/app-utils/form-dataset-binding.js.map +1 -0
  319. package/src/lib/app-utils/forms.d.ts +727 -0
  320. package/src/lib/app-utils/forms.js +777 -0
  321. package/src/lib/app-utils/forms.js.map +1 -0
  322. package/src/lib/app-utils/functions.d.ts +188 -0
  323. package/src/lib/app-utils/functions.js +529 -0
  324. package/src/lib/app-utils/functions.js.map +1 -0
  325. package/src/lib/app-utils/guarded-version-save.d.ts +91 -0
  326. package/src/lib/app-utils/guarded-version-save.js +131 -0
  327. package/src/lib/app-utils/guarded-version-save.js.map +1 -0
  328. package/src/lib/app-utils/health-report.d.ts +1766 -0
  329. package/src/lib/app-utils/health-report.js +2072 -0
  330. package/src/lib/app-utils/health-report.js.map +1 -0
  331. package/src/lib/app-utils/host-naming.d.ts +135 -0
  332. package/src/lib/app-utils/host-naming.js +188 -0
  333. package/src/lib/app-utils/host-naming.js.map +1 -0
  334. package/src/lib/app-utils/host-permissions.d.ts +76 -0
  335. package/src/lib/app-utils/host-permissions.js +119 -0
  336. package/src/lib/app-utils/host-permissions.js.map +1 -0
  337. package/src/lib/app-utils/host-tokens.d.ts +228 -0
  338. package/src/lib/app-utils/host-tokens.js +304 -0
  339. package/src/lib/app-utils/host-tokens.js.map +1 -0
  340. package/src/lib/app-utils/idp-profile.d.ts +83 -0
  341. package/src/lib/app-utils/idp-profile.js +268 -0
  342. package/src/lib/app-utils/idp-profile.js.map +1 -0
  343. package/src/lib/app-utils/image-upload-types.d.ts +49 -0
  344. package/src/lib/app-utils/image-upload-types.js +86 -0
  345. package/src/lib/app-utils/image-upload-types.js.map +1 -0
  346. package/src/lib/app-utils/index.d.ts +18 -0
  347. package/src/lib/app-utils/index.js +23 -0
  348. package/src/lib/app-utils/index.js.map +1 -0
  349. package/src/lib/app-utils/internal-traffic.d.ts +197 -0
  350. package/src/lib/app-utils/internal-traffic.js +288 -0
  351. package/src/lib/app-utils/internal-traffic.js.map +1 -0
  352. package/src/lib/app-utils/lineal-order.d.ts +62 -0
  353. package/src/lib/app-utils/lineal-order.js +65 -0
  354. package/src/lib/app-utils/lineal-order.js.map +1 -0
  355. package/src/lib/app-utils/link-references.d.ts +36 -0
  356. package/src/lib/app-utils/link-references.js +89 -0
  357. package/src/lib/app-utils/link-references.js.map +1 -0
  358. package/src/lib/app-utils/link-target-search-context.d.ts +123 -0
  359. package/src/lib/app-utils/link-target-search-context.js +221 -0
  360. package/src/lib/app-utils/link-target-search-context.js.map +1 -0
  361. package/src/lib/app-utils/list-assignment-policy.d.ts +169 -0
  362. package/src/lib/app-utils/list-assignment-policy.js +170 -0
  363. package/src/lib/app-utils/list-assignment-policy.js.map +1 -0
  364. package/src/lib/app-utils/list-import.d.ts +158 -0
  365. package/src/lib/app-utils/list-import.js +332 -0
  366. package/src/lib/app-utils/list-import.js.map +1 -0
  367. package/src/lib/app-utils/llms-txt.d.ts +104 -0
  368. package/src/lib/app-utils/llms-txt.js +144 -0
  369. package/src/lib/app-utils/llms-txt.js.map +1 -0
  370. package/src/lib/app-utils/local-storage-budget.d.ts +75 -0
  371. package/src/lib/app-utils/local-storage-budget.js +153 -0
  372. package/src/lib/app-utils/local-storage-budget.js.map +1 -0
  373. package/src/lib/app-utils/lockdown.d.ts +698 -0
  374. package/src/lib/app-utils/lockdown.js +929 -0
  375. package/src/lib/app-utils/lockdown.js.map +1 -0
  376. package/src/lib/app-utils/margin-utilization.d.ts +267 -0
  377. package/src/lib/app-utils/margin-utilization.js +351 -0
  378. package/src/lib/app-utils/margin-utilization.js.map +1 -0
  379. package/src/lib/app-utils/markdown-lite.d.ts +297 -0
  380. package/src/lib/app-utils/markdown-lite.js +705 -0
  381. package/src/lib/app-utils/markdown-lite.js.map +1 -0
  382. package/src/lib/app-utils/marketing-consent.d.ts +704 -0
  383. package/src/lib/app-utils/marketing-consent.js +783 -0
  384. package/src/lib/app-utils/marketing-consent.js.map +1 -0
  385. package/src/lib/app-utils/marketplace-listing-visibility.d.ts +120 -0
  386. package/src/lib/app-utils/marketplace-listing-visibility.js +139 -0
  387. package/src/lib/app-utils/marketplace-listing-visibility.js.map +1 -0
  388. package/src/lib/app-utils/marketplace-overrides.d.ts +271 -0
  389. package/src/lib/app-utils/marketplace-overrides.js +462 -0
  390. package/src/lib/app-utils/marketplace-overrides.js.map +1 -0
  391. package/src/lib/app-utils/marketplace-provenance.d.ts +150 -0
  392. package/src/lib/app-utils/marketplace-provenance.js +136 -0
  393. package/src/lib/app-utils/marketplace-provenance.js.map +1 -0
  394. package/src/lib/app-utils/marketplace-theme.d.ts +237 -0
  395. package/src/lib/app-utils/marketplace-theme.js +525 -0
  396. package/src/lib/app-utils/marketplace-theme.js.map +1 -0
  397. package/src/lib/app-utils/marketplace-update-state.d.ts +119 -0
  398. package/src/lib/app-utils/marketplace-update-state.js +132 -0
  399. package/src/lib/app-utils/marketplace-update-state.js.map +1 -0
  400. package/src/lib/app-utils/marketplace-verification.d.ts +95 -0
  401. package/src/lib/app-utils/marketplace-verification.js +81 -0
  402. package/src/lib/app-utils/marketplace-verification.js.map +1 -0
  403. package/src/lib/app-utils/measure-node-map.d.ts +76 -0
  404. package/src/lib/app-utils/measure-node-map.js +111 -0
  405. package/src/lib/app-utils/measure-node-map.js.map +1 -0
  406. package/src/lib/app-utils/media-alt.d.ts +55 -0
  407. package/src/lib/app-utils/media-alt.js +58 -0
  408. package/src/lib/app-utils/media-alt.js.map +1 -0
  409. package/src/lib/app-utils/media-asset-facts.d.ts +125 -0
  410. package/src/lib/app-utils/media-asset-facts.js +467 -0
  411. package/src/lib/app-utils/media-asset-facts.js.map +1 -0
  412. package/src/lib/app-utils/media-cdn-scope.d.ts +65 -0
  413. package/src/lib/app-utils/media-cdn-scope.js +75 -0
  414. package/src/lib/app-utils/media-cdn-scope.js.map +1 -0
  415. package/src/lib/app-utils/media-folders.d.ts +161 -0
  416. package/src/lib/app-utils/media-folders.js +230 -0
  417. package/src/lib/app-utils/media-folders.js.map +1 -0
  418. package/src/lib/app-utils/media-metadata.d.ts +277 -0
  419. package/src/lib/app-utils/media-metadata.js +388 -0
  420. package/src/lib/app-utils/media-metadata.js.map +1 -0
  421. package/src/lib/app-utils/media-picker-context.d.ts +93 -0
  422. package/src/lib/app-utils/media-picker-context.js +26 -0
  423. package/src/lib/app-utils/media-picker-context.js.map +1 -0
  424. package/src/lib/app-utils/media-quarantine.d.ts +247 -0
  425. package/src/lib/app-utils/media-quarantine.js +323 -0
  426. package/src/lib/app-utils/media-quarantine.js.map +1 -0
  427. package/src/lib/app-utils/media-ref.d.ts +661 -0
  428. package/src/lib/app-utils/media-ref.js +1055 -0
  429. package/src/lib/app-utils/media-ref.js.map +1 -0
  430. package/src/lib/app-utils/media-takedown-reach.d.ts +126 -0
  431. package/src/lib/app-utils/media-takedown-reach.js +143 -0
  432. package/src/lib/app-utils/media-takedown-reach.js.map +1 -0
  433. package/src/lib/app-utils/member-email-aliases.d.ts +180 -0
  434. package/src/lib/app-utils/member-email-aliases.js +217 -0
  435. package/src/lib/app-utils/member-email-aliases.js.map +1 -0
  436. package/src/lib/app-utils/merge-node-sx.d.ts +47 -0
  437. package/src/lib/app-utils/merge-node-sx.js +123 -0
  438. package/src/lib/app-utils/merge-node-sx.js.map +1 -0
  439. package/src/lib/app-utils/name-match.d.ts +155 -0
  440. package/src/lib/app-utils/name-match.js +175 -0
  441. package/src/lib/app-utils/name-match.js.map +1 -0
  442. package/src/lib/app-utils/name-search.d.ts +117 -0
  443. package/src/lib/app-utils/name-search.js +145 -0
  444. package/src/lib/app-utils/name-search.js.map +1 -0
  445. package/src/lib/app-utils/node-capabilities.d.ts +85 -0
  446. package/src/lib/app-utils/node-capabilities.js +88 -0
  447. package/src/lib/app-utils/node-capabilities.js.map +1 -0
  448. package/src/lib/app-utils/node-definition-sanitizer.d.ts +164 -0
  449. package/src/lib/app-utils/node-definition-sanitizer.js +402 -0
  450. package/src/lib/app-utils/node-definition-sanitizer.js.map +1 -0
  451. package/src/lib/app-utils/node-identity.d.ts +47 -0
  452. package/src/lib/app-utils/node-identity.js +50 -0
  453. package/src/lib/app-utils/node-identity.js.map +1 -0
  454. package/src/lib/app-utils/node-interactions.d.ts +102 -0
  455. package/src/lib/app-utils/node-interactions.js +192 -0
  456. package/src/lib/app-utils/node-interactions.js.map +1 -0
  457. package/src/lib/app-utils/node-url-policy.d.ts +54 -0
  458. package/src/lib/app-utils/node-url-policy.js +72 -0
  459. package/src/lib/app-utils/node-url-policy.js.map +1 -0
  460. package/src/lib/app-utils/notifications.d.ts +71 -0
  461. package/src/lib/app-utils/notifications.js +101 -0
  462. package/src/lib/app-utils/notifications.js.map +1 -0
  463. package/src/lib/app-utils/onboarding-deep-link.d.ts +120 -0
  464. package/src/lib/app-utils/onboarding-deep-link.js +142 -0
  465. package/src/lib/app-utils/onboarding-deep-link.js.map +1 -0
  466. package/src/lib/app-utils/operator-identity.d.ts +207 -0
  467. package/src/lib/app-utils/operator-identity.js +186 -0
  468. package/src/lib/app-utils/operator-identity.js.map +1 -0
  469. package/src/lib/app-utils/org-billing-doc.d.ts +231 -0
  470. package/src/lib/app-utils/org-billing-doc.js +238 -0
  471. package/src/lib/app-utils/org-billing-doc.js.map +1 -0
  472. package/src/lib/app-utils/org-override-reason.d.ts +100 -0
  473. package/src/lib/app-utils/org-override-reason.js +116 -0
  474. package/src/lib/app-utils/org-override-reason.js.map +1 -0
  475. package/src/lib/app-utils/org-permissions.d.ts +194 -0
  476. package/src/lib/app-utils/org-permissions.js +357 -0
  477. package/src/lib/app-utils/org-permissions.js.map +1 -0
  478. package/src/lib/app-utils/org-roles.d.ts +72 -0
  479. package/src/lib/app-utils/org-roles.js +131 -0
  480. package/src/lib/app-utils/org-roles.js.map +1 -0
  481. package/src/lib/app-utils/organizations.d.ts +407 -0
  482. package/src/lib/app-utils/organizations.js +511 -0
  483. package/src/lib/app-utils/organizations.js.map +1 -0
  484. package/src/lib/app-utils/page-header-actions-context.d.ts +83 -0
  485. package/src/lib/app-utils/page-header-actions-context.js +58 -0
  486. package/src/lib/app-utils/page-header-actions-context.js.map +1 -0
  487. package/src/lib/app-utils/page-header-record-context.d.ts +80 -0
  488. package/src/lib/app-utils/page-header-record-context.js +64 -0
  489. package/src/lib/app-utils/page-header-record-context.js.map +1 -0
  490. package/src/lib/app-utils/page-markdown.d.ts +103 -0
  491. package/src/lib/app-utils/page-markdown.js +385 -0
  492. package/src/lib/app-utils/page-markdown.js.map +1 -0
  493. package/src/lib/app-utils/paid-media-source.d.ts +90 -0
  494. package/src/lib/app-utils/paid-media-source.js +184 -0
  495. package/src/lib/app-utils/paid-media-source.js.map +1 -0
  496. package/src/lib/app-utils/palette-sx.d.ts +34 -0
  497. package/src/lib/app-utils/palette-sx.js +150 -0
  498. package/src/lib/app-utils/palette-sx.js.map +1 -0
  499. package/src/lib/app-utils/password-policy.d.ts +47 -0
  500. package/src/lib/app-utils/password-policy.js +46 -0
  501. package/src/lib/app-utils/password-policy.js.map +1 -0
  502. package/src/lib/app-utils/payments-configured.d.ts +84 -0
  503. package/src/lib/app-utils/payments-configured.js +88 -0
  504. package/src/lib/app-utils/payments-configured.js.map +1 -0
  505. package/src/lib/app-utils/person-erasure.d.ts +126 -0
  506. package/src/lib/app-utils/person-erasure.js +121 -0
  507. package/src/lib/app-utils/person-erasure.js.map +1 -0
  508. package/src/lib/app-utils/person-key.d.ts +32 -0
  509. package/src/lib/app-utils/person-key.js +62 -0
  510. package/src/lib/app-utils/person-key.js.map +1 -0
  511. package/src/lib/app-utils/plan-entitlements.d.ts +2756 -0
  512. package/src/lib/app-utils/plan-entitlements.js +4085 -0
  513. package/src/lib/app-utils/plan-entitlements.js.map +1 -0
  514. package/src/lib/app-utils/platform-ad-conversions.d.ts +122 -0
  515. package/src/lib/app-utils/platform-ad-conversions.js +174 -0
  516. package/src/lib/app-utils/platform-ad-conversions.js.map +1 -0
  517. package/src/lib/app-utils/platform-advertising-tags.d.ts +139 -0
  518. package/src/lib/app-utils/platform-advertising-tags.js +203 -0
  519. package/src/lib/app-utils/platform-advertising-tags.js.map +1 -0
  520. package/src/lib/app-utils/platform-brand.d.ts +151 -0
  521. package/src/lib/app-utils/platform-brand.js +175 -0
  522. package/src/lib/app-utils/platform-brand.js.map +1 -0
  523. package/src/lib/app-utils/platform-consent-default.d.ts +142 -0
  524. package/src/lib/app-utils/platform-consent-default.js +295 -0
  525. package/src/lib/app-utils/platform-consent-default.js.map +1 -0
  526. package/src/lib/app-utils/platform-marketing-consent.d.ts +151 -0
  527. package/src/lib/app-utils/platform-marketing-consent.js +182 -0
  528. package/src/lib/app-utils/platform-marketing-consent.js.map +1 -0
  529. package/src/lib/app-utils/platform-marketing-host.d.ts +33 -0
  530. package/src/lib/app-utils/platform-marketing-host.js +97 -0
  531. package/src/lib/app-utils/platform-marketing-host.js.map +1 -0
  532. package/src/lib/app-utils/platform-visitor-consent.d.ts +252 -0
  533. package/src/lib/app-utils/platform-visitor-consent.js +533 -0
  534. package/src/lib/app-utils/platform-visitor-consent.js.map +1 -0
  535. package/src/lib/app-utils/plugin-api-cross-origin.d.ts +61 -0
  536. package/src/lib/app-utils/plugin-api-cross-origin.js +202 -0
  537. package/src/lib/app-utils/plugin-api-cross-origin.js.map +1 -0
  538. package/src/lib/app-utils/plugin-api-rate-limit.d.ts +192 -0
  539. package/src/lib/app-utils/plugin-api-rate-limit.js +270 -0
  540. package/src/lib/app-utils/plugin-api-rate-limit.js.map +1 -0
  541. package/src/lib/app-utils/plugin-artifact-path.d.ts +32 -0
  542. package/src/lib/app-utils/plugin-artifact-path.js +33 -0
  543. package/src/lib/app-utils/plugin-artifact-path.js.map +1 -0
  544. package/src/lib/app-utils/plugin-bundle-checks.d.ts +148 -0
  545. package/src/lib/app-utils/plugin-bundle-checks.js +989 -0
  546. package/src/lib/app-utils/plugin-bundle-checks.js.map +1 -0
  547. package/src/lib/app-utils/plugin-manifest.d.ts +516 -0
  548. package/src/lib/app-utils/plugin-manifest.js +687 -0
  549. package/src/lib/app-utils/plugin-manifest.js.map +1 -0
  550. package/src/lib/app-utils/published-legal-pages.d.ts +71 -0
  551. package/src/lib/app-utils/published-legal-pages.js +90 -0
  552. package/src/lib/app-utils/published-legal-pages.js.map +1 -0
  553. package/src/lib/app-utils/publisher-agreement.d.ts +254 -0
  554. package/src/lib/app-utils/publisher-agreement.js +274 -0
  555. package/src/lib/app-utils/publisher-agreement.js.map +1 -0
  556. package/src/lib/app-utils/publisher-attestation.d.ts +99 -0
  557. package/src/lib/app-utils/publisher-attestation.js +158 -0
  558. package/src/lib/app-utils/publisher-attestation.js.map +1 -0
  559. package/src/lib/app-utils/recipient-email-render.d.ts +216 -0
  560. package/src/lib/app-utils/recipient-email-render.js +221 -0
  561. package/src/lib/app-utils/recipient-email-render.js.map +1 -0
  562. package/src/lib/app-utils/redispatch-caught-error.d.ts +38 -0
  563. package/src/lib/app-utils/redispatch-caught-error.js +46 -0
  564. package/src/lib/app-utils/redispatch-caught-error.js.map +1 -0
  565. package/src/lib/app-utils/registering-plugin.d.ts +19 -0
  566. package/src/lib/app-utils/registering-plugin.js +38 -0
  567. package/src/lib/app-utils/registering-plugin.js.map +1 -0
  568. package/src/lib/app-utils/release-flags.d.ts +283 -0
  569. package/src/lib/app-utils/release-flags.js +518 -0
  570. package/src/lib/app-utils/release-flags.js.map +1 -0
  571. package/src/lib/app-utils/repair-canvas-nodes.d.ts +130 -0
  572. package/src/lib/app-utils/repair-canvas-nodes.js +298 -0
  573. package/src/lib/app-utils/repair-canvas-nodes.js.map +1 -0
  574. package/src/lib/app-utils/repeat-infringer.d.ts +166 -0
  575. package/src/lib/app-utils/repeat-infringer.js +188 -0
  576. package/src/lib/app-utils/repeat-infringer.js.map +1 -0
  577. package/src/lib/app-utils/repeat-sources.d.ts +115 -0
  578. package/src/lib/app-utils/repeat-sources.js +86 -0
  579. package/src/lib/app-utils/repeat-sources.js.map +1 -0
  580. package/src/lib/app-utils/request-geo.d.ts +114 -0
  581. package/src/lib/app-utils/request-geo.js +247 -0
  582. package/src/lib/app-utils/request-geo.js.map +1 -0
  583. package/src/lib/app-utils/request-ip.d.ts +213 -0
  584. package/src/lib/app-utils/request-ip.js +344 -0
  585. package/src/lib/app-utils/request-ip.js.map +1 -0
  586. package/src/lib/app-utils/resolve-named-tokens.d.ts +26 -0
  587. package/src/lib/app-utils/resolve-named-tokens.js +59 -0
  588. package/src/lib/app-utils/resolve-named-tokens.js.map +1 -0
  589. package/src/lib/app-utils/responsive-typography-sx.d.ts +77 -0
  590. package/src/lib/app-utils/responsive-typography-sx.js +122 -0
  591. package/src/lib/app-utils/responsive-typography-sx.js.map +1 -0
  592. package/src/lib/app-utils/reusable-component-keys.d.ts +135 -0
  593. package/src/lib/app-utils/reusable-component-keys.js +140 -0
  594. package/src/lib/app-utils/reusable-component-keys.js.map +1 -0
  595. package/src/lib/app-utils/reusable-prop-values.d.ts +199 -0
  596. package/src/lib/app-utils/reusable-prop-values.js +494 -0
  597. package/src/lib/app-utils/reusable-prop-values.js.map +1 -0
  598. package/src/lib/app-utils/safe-json-ld.d.ts +29 -0
  599. package/src/lib/app-utils/safe-json-ld.js +37 -0
  600. package/src/lib/app-utils/safe-json-ld.js.map +1 -0
  601. package/src/lib/app-utils/sanitize-svg.d.ts +55 -0
  602. package/src/lib/app-utils/sanitize-svg.js +460 -0
  603. package/src/lib/app-utils/sanitize-svg.js.map +1 -0
  604. package/src/lib/app-utils/scheme-sx.d.ts +84 -0
  605. package/src/lib/app-utils/scheme-sx.js +148 -0
  606. package/src/lib/app-utils/scheme-sx.js.map +1 -0
  607. package/src/lib/app-utils/scope-tokens.d.ts +249 -0
  608. package/src/lib/app-utils/scope-tokens.js +331 -0
  609. package/src/lib/app-utils/scope-tokens.js.map +1 -0
  610. package/src/lib/app-utils/screen-link-context-value.d.ts +57 -0
  611. package/src/lib/app-utils/screen-link-context-value.js +43 -0
  612. package/src/lib/app-utils/screen-link-context-value.js.map +1 -0
  613. package/src/lib/app-utils/screen-link-context.d.ts +185 -0
  614. package/src/lib/app-utils/screen-link-context.js +304 -0
  615. package/src/lib/app-utils/screen-link-context.js.map +1 -0
  616. package/src/lib/app-utils/screen-link-value.d.ts +269 -0
  617. package/src/lib/app-utils/screen-link-value.js +384 -0
  618. package/src/lib/app-utils/screen-link-value.js.map +1 -0
  619. package/src/lib/app-utils/screen-route.d.ts +669 -0
  620. package/src/lib/app-utils/screen-route.js +751 -0
  621. package/src/lib/app-utils/screen-route.js.map +1 -0
  622. package/src/lib/app-utils/screen-seo-fields.d.ts +37 -0
  623. package/src/lib/app-utils/screen-seo-fields.js +42 -0
  624. package/src/lib/app-utils/screen-seo-fields.js.map +1 -0
  625. package/src/lib/app-utils/search-indexing.d.ts +162 -0
  626. package/src/lib/app-utils/search-indexing.js +207 -0
  627. package/src/lib/app-utils/search-indexing.js.map +1 -0
  628. package/src/lib/app-utils/seo-listing-fields.d.ts +70 -0
  629. package/src/lib/app-utils/seo-listing-fields.js +75 -0
  630. package/src/lib/app-utils/seo-listing-fields.js.map +1 -0
  631. package/src/lib/app-utils/seo-locale.d.ts +119 -0
  632. package/src/lib/app-utils/seo-locale.js +133 -0
  633. package/src/lib/app-utils/seo-locale.js.map +1 -0
  634. package/src/lib/app-utils/seo-title-variables.d.ts +149 -0
  635. package/src/lib/app-utils/seo-title-variables.js +190 -0
  636. package/src/lib/app-utils/seo-title-variables.js.map +1 -0
  637. package/src/lib/app-utils/seo-title.d.ts +70 -0
  638. package/src/lib/app-utils/seo-title.js +117 -0
  639. package/src/lib/app-utils/seo-title.js.map +1 -0
  640. package/src/lib/app-utils/server.d.ts +174 -0
  641. package/src/lib/app-utils/server.js +314 -0
  642. package/src/lib/app-utils/server.js.map +1 -0
  643. package/src/lib/app-utils/site-context.d.ts +106 -0
  644. package/src/lib/app-utils/site-context.js +100 -0
  645. package/src/lib/app-utils/site-context.js.map +1 -0
  646. package/src/lib/app-utils/sitemap.d.ts +117 -0
  647. package/src/lib/app-utils/sitemap.js +183 -0
  648. package/src/lib/app-utils/sitemap.js.map +1 -0
  649. package/src/lib/app-utils/social-image.d.ts +112 -0
  650. package/src/lib/app-utils/social-image.js +191 -0
  651. package/src/lib/app-utils/social-image.js.map +1 -0
  652. package/src/lib/app-utils/starter-templates.d.ts +99 -0
  653. package/src/lib/app-utils/starter-templates.js +579 -0
  654. package/src/lib/app-utils/starter-templates.js.map +1 -0
  655. package/src/lib/app-utils/stored-nodes.d.ts +120 -0
  656. package/src/lib/app-utils/stored-nodes.js +174 -0
  657. package/src/lib/app-utils/stored-nodes.js.map +1 -0
  658. package/src/lib/app-utils/strip-undefined.d.ts +59 -0
  659. package/src/lib/app-utils/strip-undefined.js +95 -0
  660. package/src/lib/app-utils/strip-undefined.js.map +1 -0
  661. package/src/lib/app-utils/stripe-deployment-mode.d.ts +47 -0
  662. package/src/lib/app-utils/stripe-deployment-mode.js +70 -0
  663. package/src/lib/app-utils/stripe-deployment-mode.js.map +1 -0
  664. package/src/lib/app-utils/support-tiers.d.ts +108 -0
  665. package/src/lib/app-utils/support-tiers.js +201 -0
  666. package/src/lib/app-utils/support-tiers.js.map +1 -0
  667. package/src/lib/app-utils/timezone-geo-hint.d.ts +36 -0
  668. package/src/lib/app-utils/timezone-geo-hint.js +180 -0
  669. package/src/lib/app-utils/timezone-geo-hint.js.map +1 -0
  670. package/src/lib/app-utils/upload-cors.d.ts +155 -0
  671. package/src/lib/app-utils/upload-cors.js +254 -0
  672. package/src/lib/app-utils/upload-cors.js.map +1 -0
  673. package/src/lib/app-utils/upload-inspection.d.ts +159 -0
  674. package/src/lib/app-utils/upload-inspection.js +539 -0
  675. package/src/lib/app-utils/upload-inspection.js.map +1 -0
  676. package/src/lib/app-utils/url-slug.d.ts +40 -0
  677. package/src/lib/app-utils/url-slug.js +42 -0
  678. package/src/lib/app-utils/url-slug.js.map +1 -0
  679. package/src/lib/app-utils/usage-budget.d.ts +429 -0
  680. package/src/lib/app-utils/usage-budget.js +421 -0
  681. package/src/lib/app-utils/usage-budget.js.map +1 -0
  682. package/src/lib/app-utils/variables.d.ts +96 -0
  683. package/src/lib/app-utils/variables.js +233 -0
  684. package/src/lib/app-utils/variables.js.map +1 -0
  685. package/src/lib/app-utils/video-asset-facts.d.ts +61 -0
  686. package/src/lib/app-utils/video-asset-facts.js +70 -0
  687. package/src/lib/app-utils/video-asset-facts.js.map +1 -0
  688. package/src/lib/app-utils/video-object.d.ts +89 -0
  689. package/src/lib/app-utils/video-object.js +245 -0
  690. package/src/lib/app-utils/video-object.js.map +1 -0
  691. package/src/lib/app-utils/visitor-consent.d.ts +757 -0
  692. package/src/lib/app-utils/visitor-consent.js +981 -0
  693. package/src/lib/app-utils/visitor-consent.js.map +1 -0
  694. package/src/lib/app-utils/visitor-record-ceiling.d.ts +223 -0
  695. package/src/lib/app-utils/visitor-record-ceiling.js +215 -0
  696. package/src/lib/app-utils/visitor-record-ceiling.js.map +1 -0
  697. package/src/lib/app-utils/web-vitals-rum.d.ts +53 -0
  698. package/src/lib/app-utils/web-vitals-rum.js +278 -0
  699. package/src/lib/app-utils/web-vitals-rum.js.map +1 -0
  700. package/src/lib/app-utils/webhook-delivery.d.ts +324 -0
  701. package/src/lib/app-utils/webhook-delivery.js +413 -0
  702. package/src/lib/app-utils/webhook-delivery.js.map +1 -0
  703. package/src/lib/app-utils/where-used.d.ts +57 -0
  704. package/src/lib/app-utils/where-used.js +59 -0
  705. package/src/lib/app-utils/where-used.js.map +1 -0
  706. package/src/lib/app-utils/wistia-embed.d.ts +86 -0
  707. package/src/lib/app-utils/wistia-embed.js +119 -0
  708. package/src/lib/app-utils/wistia-embed.js.map +1 -0
  709. package/src/lib/app-utils/workflows.d.ts +136 -0
  710. package/src/lib/app-utils/workflows.js +346 -0
  711. package/src/lib/app-utils/workflows.js.map +1 -0
  712. package/src/lib/canvas-manager/canvas-manager-tree.d.ts +109 -0
  713. package/src/lib/canvas-manager/canvas-manager-tree.js +139 -0
  714. package/src/lib/canvas-manager/canvas-manager-tree.js.map +1 -0
  715. package/src/lib/canvas-manager/canvas-manager.d.ts +549 -0
  716. package/src/lib/canvas-manager/canvas-manager.js +1311 -0
  717. package/src/lib/canvas-manager/canvas-manager.js.map +1 -0
  718. package/src/lib/canvas-manager/index.d.ts +20 -0
  719. package/src/lib/canvas-manager/index.js +21 -0
  720. package/src/lib/canvas-manager/index.js.map +1 -0
  721. package/src/lib/canvas-manager/stores/index.d.ts +17 -0
  722. package/src/lib/canvas-manager/stores/index.js +18 -0
  723. package/src/lib/canvas-manager/stores/index.js.map +1 -0
  724. package/src/lib/canvas-manager/stores/node.store.d.ts +30 -0
  725. package/src/lib/canvas-manager/stores/node.store.js +45 -0
  726. package/src/lib/canvas-manager/stores/node.store.js.map +1 -0
  727. package/src/lib/components-manager/components-manager.d.ts +56 -0
  728. package/src/lib/components-manager/components-manager.js +191 -0
  729. package/src/lib/components-manager/components-manager.js.map +1 -0
  730. package/src/lib/components-manager/index.d.ts +18 -0
  731. package/src/lib/components-manager/index.js +19 -0
  732. package/src/lib/components-manager/index.js.map +1 -0
  733. package/src/lib/emit-manager/emit-manager.d.ts +56 -0
  734. package/src/lib/emit-manager/emit-manager.js +60 -0
  735. package/src/lib/emit-manager/emit-manager.js.map +1 -0
  736. package/src/lib/emit-manager/index.d.ts +18 -0
  737. package/src/lib/emit-manager/index.js +19 -0
  738. package/src/lib/emit-manager/index.js.map +1 -0
  739. package/src/lib/foundation/constants/_internal.d.ts +18 -0
  740. package/src/lib/foundation/constants/_internal.js +62 -0
  741. package/src/lib/foundation/constants/_internal.js.map +1 -0
  742. package/src/lib/foundation/constants/app.d.ts +23 -0
  743. package/src/lib/foundation/constants/app.js +25 -0
  744. package/src/lib/foundation/constants/app.js.map +1 -0
  745. package/src/lib/foundation/constants/canvas.d.ts +18 -0
  746. package/src/lib/foundation/constants/canvas.js +18 -0
  747. package/src/lib/foundation/constants/canvas.js.map +1 -0
  748. package/src/lib/foundation/constants/components.d.ts +54 -0
  749. package/src/lib/foundation/constants/components.js +61 -0
  750. package/src/lib/foundation/constants/components.js.map +1 -0
  751. package/src/lib/foundation/constants/shared.d.ts +50 -0
  752. package/src/lib/foundation/constants/shared.js +49 -0
  753. package/src/lib/foundation/constants/shared.js.map +1 -0
  754. package/src/lib/foundation/constants/symbol.d.ts +63 -0
  755. package/src/lib/foundation/constants/symbol.js +75 -0
  756. package/src/lib/foundation/constants/symbol.js.map +1 -0
  757. package/src/lib/foundation/definitions/components.types.d.ts +372 -0
  758. package/src/lib/foundation/definitions/components.types.js +180 -0
  759. package/src/lib/foundation/definitions/components.types.js.map +1 -0
  760. package/src/lib/foundation/definitions/contact.types.d.ts +73 -0
  761. package/src/lib/foundation/definitions/contact.types.js +107 -0
  762. package/src/lib/foundation/definitions/contact.types.js.map +1 -0
  763. package/src/lib/foundation/definitions/host-content-collections.d.ts +137 -0
  764. package/src/lib/foundation/definitions/host-content-collections.js +219 -0
  765. package/src/lib/foundation/definitions/host-content-collections.js.map +1 -0
  766. package/src/lib/foundation/definitions/org-billing.types.d.ts +1361 -0
  767. package/src/lib/foundation/definitions/org-billing.types.js +77 -0
  768. package/src/lib/foundation/definitions/org-billing.types.js.map +1 -0
  769. package/src/lib/foundation/definitions/organization.types.d.ts +307 -0
  770. package/src/lib/foundation/definitions/organization.types.js +42 -0
  771. package/src/lib/foundation/definitions/organization.types.js.map +1 -0
  772. package/src/lib/foundation/definitions/platform.types.d.ts +1326 -0
  773. package/src/lib/foundation/definitions/platform.types.js +124 -0
  774. package/src/lib/foundation/definitions/platform.types.js.map +1 -0
  775. package/src/lib/foundation/definitions/property-kinds.d.ts +189 -0
  776. package/src/lib/foundation/definitions/property-kinds.js +565 -0
  777. package/src/lib/foundation/definitions/property-kinds.js.map +1 -0
  778. package/src/lib/foundation/definitions/shared.d.ts +23 -0
  779. package/src/lib/foundation/definitions/shared.js +18 -0
  780. package/src/lib/foundation/definitions/shared.js.map +1 -0
  781. package/src/lib/foundation/definitions/write-deny-coverage.util.d.ts +249 -0
  782. package/src/lib/foundation/definitions/write-deny-coverage.util.js +499 -0
  783. package/src/lib/foundation/definitions/write-deny-coverage.util.js.map +1 -0
  784. package/src/lib/foundation/index.d.ts +32 -0
  785. package/src/lib/foundation/index.js +67 -0
  786. package/src/lib/foundation/index.js.map +1 -0
  787. package/src/lib/lifecycle.d.ts +24 -0
  788. package/src/lib/lifecycle.js +39 -0
  789. package/src/lib/lifecycle.js.map +1 -0
  790. package/src/lib/mst/common.d.ts +17 -0
  791. package/src/lib/mst/common.js +23 -0
  792. package/src/lib/mst/common.js.map +1 -0
  793. package/src/lib/mst/index.d.ts +19 -0
  794. package/src/lib/mst/index.js +20 -0
  795. package/src/lib/mst/index.js.map +1 -0
  796. package/src/lib/mst/json.d.ts +22 -0
  797. package/src/lib/mst/json.js +23 -0
  798. package/src/lib/mst/json.js.map +1 -0
  799. package/src/lib/mst/types.d.ts +20 -0
  800. package/src/lib/mst/types.js +18 -0
  801. package/src/lib/mst/types.js.map +1 -0
  802. package/src/lib/plugin-manager/billing-webhook-hooks.d.ts +77 -0
  803. package/src/lib/plugin-manager/billing-webhook-hooks.js +55 -0
  804. package/src/lib/plugin-manager/billing-webhook-hooks.js.map +1 -0
  805. package/src/lib/plugin-manager/commerce-zone-props.d.ts +172 -0
  806. package/src/lib/plugin-manager/commerce-zone-props.js +31 -0
  807. package/src/lib/plugin-manager/commerce-zone-props.js.map +1 -0
  808. package/src/lib/plugin-manager/custom-fields.d.ts +60 -0
  809. package/src/lib/plugin-manager/custom-fields.js +39 -0
  810. package/src/lib/plugin-manager/custom-fields.js.map +1 -0
  811. package/src/lib/plugin-manager/editor-sessions.d.ts +109 -0
  812. package/src/lib/plugin-manager/editor-sessions.js +137 -0
  813. package/src/lib/plugin-manager/editor-sessions.js.map +1 -0
  814. package/src/lib/plugin-manager/enabled-plugins.d.ts +438 -0
  815. package/src/lib/plugin-manager/enabled-plugins.js +403 -0
  816. package/src/lib/plugin-manager/enabled-plugins.js.map +1 -0
  817. package/src/lib/plugin-manager/feature-plugins.d.ts +1314 -0
  818. package/src/lib/plugin-manager/feature-plugins.js +609 -0
  819. package/src/lib/plugin-manager/feature-plugins.js.map +1 -0
  820. package/src/lib/plugin-manager/first-party-plugins.generated.d.ts +11 -0
  821. package/src/lib/plugin-manager/first-party-plugins.generated.js +149 -0
  822. package/src/lib/plugin-manager/first-party-plugins.generated.js.map +1 -0
  823. package/src/lib/plugin-manager/index.d.ts +42 -0
  824. package/src/lib/plugin-manager/index.js +46 -0
  825. package/src/lib/plugin-manager/index.js.map +1 -0
  826. package/src/lib/plugin-manager/install-presets.d.ts +93 -0
  827. package/src/lib/plugin-manager/install-presets.js +86 -0
  828. package/src/lib/plugin-manager/install-presets.js.map +1 -0
  829. package/src/lib/plugin-manager/media-delivery-provider.d.ts +124 -0
  830. package/src/lib/plugin-manager/media-delivery-provider.js +53 -0
  831. package/src/lib/plugin-manager/media-delivery-provider.js.map +1 -0
  832. package/src/lib/plugin-manager/order-fulfilment.d.ts +142 -0
  833. package/src/lib/plugin-manager/order-fulfilment.js +104 -0
  834. package/src/lib/plugin-manager/order-fulfilment.js.map +1 -0
  835. package/src/lib/plugin-manager/plugin-activity-actions.d.ts +122 -0
  836. package/src/lib/plugin-manager/plugin-activity-actions.js +140 -0
  837. package/src/lib/plugin-manager/plugin-activity-actions.js.map +1 -0
  838. package/src/lib/plugin-manager/plugin-bridge.d.ts +98 -0
  839. package/src/lib/plugin-manager/plugin-bridge.js +154 -0
  840. package/src/lib/plugin-manager/plugin-bridge.js.map +1 -0
  841. package/src/lib/plugin-manager/plugin-config.d.ts +148 -0
  842. package/src/lib/plugin-manager/plugin-config.js +228 -0
  843. package/src/lib/plugin-manager/plugin-config.js.map +1 -0
  844. package/src/lib/plugin-manager/plugin-console-crons.d.ts +139 -0
  845. package/src/lib/plugin-manager/plugin-console-crons.js +177 -0
  846. package/src/lib/plugin-manager/plugin-console-crons.js.map +1 -0
  847. package/src/lib/plugin-manager/plugin-contact-capture.d.ts +220 -0
  848. package/src/lib/plugin-manager/plugin-contact-capture.js +89 -0
  849. package/src/lib/plugin-manager/plugin-contact-capture.js.map +1 -0
  850. package/src/lib/plugin-manager/plugin-contributions.d.ts +244 -0
  851. package/src/lib/plugin-manager/plugin-contributions.js +283 -0
  852. package/src/lib/plugin-manager/plugin-contributions.js.map +1 -0
  853. package/src/lib/plugin-manager/plugin-entitlement-keys.d.ts +169 -0
  854. package/src/lib/plugin-manager/plugin-entitlement-keys.js +84 -0
  855. package/src/lib/plugin-manager/plugin-entitlement-keys.js.map +1 -0
  856. package/src/lib/plugin-manager/plugin-entitlements.d.ts +181 -0
  857. package/src/lib/plugin-manager/plugin-entitlements.js +188 -0
  858. package/src/lib/plugin-manager/plugin-entitlements.js.map +1 -0
  859. package/src/lib/plugin-manager/plugin-events.d.ts +145 -0
  860. package/src/lib/plugin-manager/plugin-events.js +79 -0
  861. package/src/lib/plugin-manager/plugin-events.js.map +1 -0
  862. package/src/lib/plugin-manager/plugin-figures.d.ts +251 -0
  863. package/src/lib/plugin-manager/plugin-figures.js +252 -0
  864. package/src/lib/plugin-manager/plugin-figures.js.map +1 -0
  865. package/src/lib/plugin-manager/plugin-host-collections.d.ts +146 -0
  866. package/src/lib/plugin-manager/plugin-host-collections.js +116 -0
  867. package/src/lib/plugin-manager/plugin-host-collections.js.map +1 -0
  868. package/src/lib/plugin-manager/plugin-jobs.d.ts +130 -0
  869. package/src/lib/plugin-manager/plugin-jobs.js +182 -0
  870. package/src/lib/plugin-manager/plugin-jobs.js.map +1 -0
  871. package/src/lib/plugin-manager/plugin-loader.d.ts +86 -0
  872. package/src/lib/plugin-manager/plugin-loader.js +223 -0
  873. package/src/lib/plugin-manager/plugin-loader.js.map +1 -0
  874. package/src/lib/plugin-manager/plugin-manager.d.ts +95 -0
  875. package/src/lib/plugin-manager/plugin-manager.js +343 -0
  876. package/src/lib/plugin-manager/plugin-manager.js.map +1 -0
  877. package/src/lib/plugin-manager/plugin-metered-lines.d.ts +97 -0
  878. package/src/lib/plugin-manager/plugin-metered-lines.js +123 -0
  879. package/src/lib/plugin-manager/plugin-metered-lines.js.map +1 -0
  880. package/src/lib/plugin-manager/plugin-org-erasure.d.ts +52 -0
  881. package/src/lib/plugin-manager/plugin-org-erasure.js +100 -0
  882. package/src/lib/plugin-manager/plugin-org-erasure.js.map +1 -0
  883. package/src/lib/plugin-manager/plugin-permissions.d.ts +69 -0
  884. package/src/lib/plugin-manager/plugin-permissions.js +77 -0
  885. package/src/lib/plugin-manager/plugin-permissions.js.map +1 -0
  886. package/src/lib/plugin-manager/plugin-person-erasure.d.ts +58 -0
  887. package/src/lib/plugin-manager/plugin-person-erasure.js +109 -0
  888. package/src/lib/plugin-manager/plugin-person-erasure.js.map +1 -0
  889. package/src/lib/plugin-manager/plugin-record-cards.d.ts +99 -0
  890. package/src/lib/plugin-manager/plugin-record-cards.js +59 -0
  891. package/src/lib/plugin-manager/plugin-record-cards.js.map +1 -0
  892. package/src/lib/plugin-manager/plugin-record-facts.d.ts +111 -0
  893. package/src/lib/plugin-manager/plugin-record-facts.js +51 -0
  894. package/src/lib/plugin-manager/plugin-record-facts.js.map +1 -0
  895. package/src/lib/plugin-manager/plugin-record-routes.d.ts +129 -0
  896. package/src/lib/plugin-manager/plugin-record-routes.js +93 -0
  897. package/src/lib/plugin-manager/plugin-record-routes.js.map +1 -0
  898. package/src/lib/plugin-manager/plugin-record-timeline.d.ts +147 -0
  899. package/src/lib/plugin-manager/plugin-record-timeline.js +39 -0
  900. package/src/lib/plugin-manager/plugin-record-timeline.js.map +1 -0
  901. package/src/lib/plugin-manager/plugin-resource-drafts.d.ts +137 -0
  902. package/src/lib/plugin-manager/plugin-resource-drafts.js +51 -0
  903. package/src/lib/plugin-manager/plugin-resource-drafts.js.map +1 -0
  904. package/src/lib/plugin-manager/plugin-services.d.ts +94 -0
  905. package/src/lib/plugin-manager/plugin-services.js +153 -0
  906. package/src/lib/plugin-manager/plugin-services.js.map +1 -0
  907. package/src/lib/plugin-manager/plugin-styles-ui.d.ts +71 -0
  908. package/src/lib/plugin-manager/plugin-styles-ui.js +80 -0
  909. package/src/lib/plugin-manager/plugin-styles-ui.js.map +1 -0
  910. package/src/lib/plugin-manager/plugin-styles.d.ts +176 -0
  911. package/src/lib/plugin-manager/plugin-styles.js +186 -0
  912. package/src/lib/plugin-manager/plugin-styles.js.map +1 -0
  913. package/src/lib/plugin-manager/plugin-subprocessors.d.ts +135 -0
  914. package/src/lib/plugin-manager/plugin-subprocessors.js +129 -0
  915. package/src/lib/plugin-manager/plugin-subprocessors.js.map +1 -0
  916. package/src/lib/plugin-manager/plugin-tax-profile.d.ts +84 -0
  917. package/src/lib/plugin-manager/plugin-tax-profile.js +39 -0
  918. package/src/lib/plugin-manager/plugin-tax-profile.js.map +1 -0
  919. package/src/lib/plugin-manager/plugin-user-erasure.d.ts +53 -0
  920. package/src/lib/plugin-manager/plugin-user-erasure.js +84 -0
  921. package/src/lib/plugin-manager/plugin-user-erasure.js.map +1 -0
  922. package/src/lib/plugin-manager/plugin-zones.d.ts +121 -0
  923. package/src/lib/plugin-manager/plugin-zones.js +74 -0
  924. package/src/lib/plugin-manager/plugin-zones.js.map +1 -0
  925. package/src/lib/plugin-manager/realm-plugins.d.ts +112 -0
  926. package/src/lib/plugin-manager/realm-plugins.js +196 -0
  927. package/src/lib/plugin-manager/realm-plugins.js.map +1 -0
  928. package/src/lib/plugin-manager/realm-server.d.ts +54 -0
  929. package/src/lib/plugin-manager/realm-server.js +88 -0
  930. package/src/lib/plugin-manager/realm-server.js.map +1 -0
  931. package/src/lib/plugin-manager/record-zone-props.d.ts +126 -0
  932. package/src/lib/plugin-manager/record-zone-props.js +31 -0
  933. package/src/lib/plugin-manager/record-zone-props.js.map +1 -0
  934. package/src/lib/plugin-manager/site-page-hooks.d.ts +102 -0
  935. package/src/lib/plugin-manager/site-page-hooks.js +114 -0
  936. package/src/lib/plugin-manager/site-page-hooks.js.map +1 -0
  937. package/src/lib/plugin-manager/site-runtime.d.ts +57 -0
  938. package/src/lib/plugin-manager/site-runtime.js +25 -0
  939. package/src/lib/plugin-manager/site-runtime.js.map +1 -0
  940. package/src/lib/plugin-manager/usage-alert-contributors.d.ts +115 -0
  941. package/src/lib/plugin-manager/usage-alert-contributors.js +106 -0
  942. package/src/lib/plugin-manager/usage-alert-contributors.js.map +1 -0
  943. package/src/lib/types/ast.d.ts +199 -0
  944. package/src/lib/types/ast.js +20 -0
  945. package/src/lib/types/ast.js.map +1 -0
  946. package/src/lib/types/index.d.ts +20 -0
  947. package/src/lib/types/index.js +21 -0
  948. package/src/lib/types/index.js.map +1 -0
  949. package/src/lib/types/nodes.d.ts +608 -0
  950. package/src/lib/types/nodes.js +28 -0
  951. package/src/lib/types/nodes.js.map +1 -0
  952. package/src/lib/types/routing.d.ts +17 -0
  953. package/src/lib/types/routing.js +18 -0
  954. package/src/lib/types/routing.js.map +1 -0
  955. package/src/lib/types/screen.d.ts +23 -0
  956. package/src/lib/types/screen.js +18 -0
  957. package/src/lib/types/screen.js.map +1 -0
  958. package/src/lib/utils.d.ts +25 -0
  959. package/src/lib/utils.js +42 -0
  960. package/src/lib/utils.js.map +1 -0
  961. package/src/server.d.ts +37 -0
  962. package/src/server.js +55 -0
  963. package/src/server.js.map +1 -0
@@ -0,0 +1,1311 @@
1
+ import { _ as _extends } from "@swc/helpers/_/_extends";
2
+ /**
3
+ * @license
4
+ * Copyright 2026 Aglyn LLC
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */ import { _isObj, _isStrT } from "@aglyn/shared-util-tools";
18
+ import { arraySafe } from "@aglyn/shared-util-tools";
19
+ import cloneDeep from "lodash-es/cloneDeep.js";
20
+ import isEqual from "lodash-es/isEqual.js";
21
+ import { action, computed, makeAutoObservable, makeObservable, observable, runInAction, toJS } from "mobx";
22
+ // The leaf module, not the 68 KB package bundle — see the note there.
23
+ import { computedFn } from "@aglyn/shared-util-vendor/mobx-computed-fn";
24
+ import { schemaAcceptsChildren } from "../app-utils/child-contract.js";
25
+ import { REUSABLE_INSTANCE_COMPONENT_ID } from "../app-utils/reusable-component-keys.js";
26
+ import { stripUndefinedDeep } from "../app-utils/strip-undefined.js";
27
+ import { createIdUrlSafe } from "../foundation/constants/app.js";
28
+ import { NodeType } from "../types/nodes.js";
29
+ export const NODE_ROOT_ID = '_@_';
30
+ export const NODE_ROOT_LABEL = 'Document';
31
+ export class AglynNode {
32
+ get parent() {
33
+ if (!this.parentId) return;
34
+ return this.store.getNode(this.parentId);
35
+ }
36
+ get index() {
37
+ return this.store.getNodeIndex(this);
38
+ }
39
+ get children() {
40
+ var _this_nodes;
41
+ const res = [];
42
+ // `?? []`, not `||= []` — a computed getter must not assign to observable
43
+ // state, and this only reads (AGL-763).
44
+ for (const $id of (_this_nodes = this.nodes) != null ? _this_nodes : []){
45
+ const node = this.store.getNode($id);
46
+ if (node) res.push(node);
47
+ }
48
+ return res;
49
+ }
50
+ get labelShort() {
51
+ return this.store.getNodeLabelShort(this);
52
+ }
53
+ get breadcrumbPath() {
54
+ return this.store.getNodeBreadcrumbPath(this);
55
+ }
56
+ get componentSchema() {
57
+ if (!this.componentId) return;
58
+ return this.store.aglyn.components.getSchema(this.componentId);
59
+ }
60
+ get hasNodes() {
61
+ return Array.isArray(this.nodes) && this.nodes.length > 0;
62
+ }
63
+ get resolvedProps() {
64
+ var _this_componentSchema;
65
+ const resolveProps = (_this_componentSchema = this.componentSchema) == null ? void 0 : _this_componentSchema.resolveProps;
66
+ if (typeof resolveProps === 'function') {
67
+ return resolveProps(this) || {};
68
+ }
69
+ return this.props;
70
+ }
71
+ get asJSON() {
72
+ return this.toJSON();
73
+ }
74
+ delete() {
75
+ this.store.deleteNode(this);
76
+ }
77
+ constructor(schema, store){
78
+ this.store = store;
79
+ this.toJSON = ()=>{
80
+ const json = {
81
+ $id: this.$id,
82
+ type: this.type
83
+ };
84
+ // Omit optional scalar fields when undefined — Firestore rejects undefined values
85
+ if (this.name !== undefined) json['name'] = this.name;
86
+ if (this.parentId !== undefined) json['parentId'] = this.parentId;
87
+ if (this.pluginId !== undefined) json['pluginId'] = this.pluginId;
88
+ if (this.componentId !== undefined) json['componentId'] = this.componentId;
89
+ if (this.className !== undefined) json['className'] = this.className;
90
+ // Omit collection fields when empty to save Firestore storage
91
+ const nodes = this.nodes ? [
92
+ ...this.nodes
93
+ ] : [];
94
+ if (nodes.length > 0) json['nodes'] = nodes;
95
+ // The scalar omissions above stopped at the top level, so an OWN key
96
+ // holding `undefined` inside these bags still reached storage (AGL-1334).
97
+ // An editor form writes the whole field set back, so a never-set or
98
+ // cleared optional attribute is such a key — and the two write paths then
99
+ // disagreed: a save msgpacked it to `null`, a publish handed `undefined`
100
+ // straight to `updateDoc()`, which rejects it. Stripping HERE is what
101
+ // makes save and publish agree: both serialize from this one method.
102
+ const props = stripUndefinedDeep(toJS(this.props));
103
+ if (props && Object.keys(props).length > 0) json['props'] = props;
104
+ const sx = stripUndefinedDeep(toJS(this.sx));
105
+ const sxEmpty = Array.isArray(sx) ? sx.length === 0 : !sx || Object.keys(sx).length === 0;
106
+ if (!sxEmpty) json['sx'] = sx;
107
+ // Instance style overrides (AGL-1306): emitted like sx — absent when
108
+ // empty — so the SAVED node map carries them into both storage forms
109
+ // (the plain map and the msgpack bytes both serialize this output).
110
+ const styleOverrides = stripUndefinedDeep(toJS(this.styleOverrides));
111
+ if (styleOverrides && Object.keys(styleOverrides).length > 0) {
112
+ json['styleOverrides'] = styleOverrides;
113
+ }
114
+ // Instance attribute overrides (AGL-1899): same treatment, same reason.
115
+ const attrOverrides = stripUndefinedDeep(toJS(this.attrOverrides));
116
+ if (attrOverrides && Object.keys(attrOverrides).length > 0) {
117
+ json['attrOverrides'] = attrOverrides;
118
+ }
119
+ // Element interactions: emitted like the bags above, absent
120
+ // when empty. This is the field that makes them versioned with the
121
+ // document at all — an interaction the canvas holds but this method
122
+ // does not write is one that never reaches a save.
123
+ const interactions = stripUndefinedDeep(toJS(this.interactions));
124
+ if (Array.isArray(interactions) && interactions.length > 0) {
125
+ json['interactions'] = interactions;
126
+ }
127
+ // Author visibility. Emitted only when TRUE: `false` and
128
+ // absent mean the same thing, and a field on every node in the document
129
+ // is bytes on every save and every page.
130
+ if (this.hidden) json['hidden'] = true;
131
+ return json;
132
+ };
133
+ this.$id = schema.$id;
134
+ this.name = schema.name;
135
+ this.type = schema.type || NodeType.NODE;
136
+ this.parentId = schema.parentId;
137
+ this.pluginId = schema.pluginId;
138
+ this.componentId = schema.componentId;
139
+ this.className = schema.className;
140
+ this.nodes = Array.isArray(schema.nodes) ? [
141
+ ...schema.nodes
142
+ ] : [];
143
+ this.props = _extends({}, schema.props);
144
+ this.sx = Array.isArray(schema.sx) ? [
145
+ ...schema.sx
146
+ ] : _extends({}, schema.sx);
147
+ this.styleOverrides = schema.styleOverrides ? _extends({}, schema.styleOverrides) : undefined;
148
+ this.attrOverrides = schema.attrOverrides ? _extends({}, schema.attrOverrides) : undefined;
149
+ this.interactions = Array.isArray(schema.interactions) ? [
150
+ ...schema.interactions
151
+ ] : undefined;
152
+ this.hidden = schema.hidden || undefined;
153
+ makeAutoObservable(this, {
154
+ store: false,
155
+ toJSON: false
156
+ });
157
+ }
158
+ }
159
+ let HistoryManager = class HistoryManager {
160
+ get [Symbol.toStringTag]() {
161
+ return 'HistoryManager';
162
+ }
163
+ toString() {
164
+ return '[object HistoryManager]';
165
+ }
166
+ toJSON() {
167
+ return {
168
+ past: toJS(this.past),
169
+ present: toJS(this.present),
170
+ future: toJS(this.future)
171
+ };
172
+ }
173
+ get canUndo() {
174
+ return this.past.length >= 1;
175
+ }
176
+ get canRedo() {
177
+ return this.future.length >= 1;
178
+ }
179
+ undo(epoch) {
180
+ if (!this.canUndo) throw new Error('No history to undo');
181
+ this.future.push({
182
+ nodes: toJS(this.present),
183
+ epoch
184
+ });
185
+ return this.past.pop();
186
+ }
187
+ redo(epoch) {
188
+ if (!this.canRedo) throw new Error('No history to redo');
189
+ this.past.push({
190
+ nodes: toJS(this.present),
191
+ epoch
192
+ });
193
+ return this.future.pop();
194
+ }
195
+ clearPast() {
196
+ this.past.clear();
197
+ return this;
198
+ }
199
+ clearFuture() {
200
+ this.future.clear();
201
+ return this;
202
+ }
203
+ clearHistory() {
204
+ this.clearPast();
205
+ this.clearFuture();
206
+ return this;
207
+ }
208
+ saveHistory(epoch) {
209
+ this.clearFuture();
210
+ this.past.push({
211
+ nodes: toJS(this.present),
212
+ epoch
213
+ });
214
+ return this;
215
+ }
216
+ constructor(){
217
+ this.present = observable.map({});
218
+ this.past = observable.array([], {
219
+ deep: false
220
+ });
221
+ this.future = observable.array([], {
222
+ deep: false
223
+ });
224
+ makeObservable(this, {
225
+ canUndo: computed,
226
+ canRedo: computed,
227
+ undo: action,
228
+ redo: action,
229
+ clearPast: action,
230
+ clearFuture: action,
231
+ clearHistory: action,
232
+ saveHistory: action
233
+ });
234
+ }
235
+ };
236
+ export class CanvasManager {
237
+ get nodes() {
238
+ return this._history.present;
239
+ }
240
+ get canRedo() {
241
+ return this._history.canRedo;
242
+ }
243
+ get canUndo() {
244
+ return this._history.canUndo;
245
+ }
246
+ /**
247
+ * True when the canvas matches the last state the store is known to hold —
248
+ * i.e. there is nothing to save.
249
+ *
250
+ * An UNCONFIRMED baseline (see {@link updateInitialNodes}) always reads as
251
+ * different. The editor is loaded, but nothing in it is known to be
252
+ * persisted, and "clean" here disables Save: claiming a state is saved on
253
+ * the strength of a snapshot the server never acknowledged is how unsaved
254
+ * work becomes unsavable work (AGL-1262).
255
+ */ get isInitialSame() {
256
+ if (!this._initial) return true;
257
+ if (!this._initialConfirmed) return false;
258
+ return isEqual(this._initial, this.serializeNodes());
259
+ }
260
+ get didSetInitial() {
261
+ return Boolean(this._initial);
262
+ }
263
+ /** Whether the recorded baseline is one the store confirmed. */ get isInitialConfirmed() {
264
+ return this._initialConfirmed;
265
+ }
266
+ get rootNode() {
267
+ return this.nodes.get(NODE_ROOT_ID);
268
+ }
269
+ get nestedNodes() {
270
+ const root = this.rootNode;
271
+ if (!root) throw new Error('Missing root node');
272
+ return this.makeNested(root);
273
+ }
274
+ /**
275
+ * Resolve where a newly inserted node should attach, given the node the
276
+ * user had selected (the Insert menu passes the current selection). A
277
+ * container target — including the document-root fallback for a missing,
278
+ * stale, or non-node target (AGL-537) — receives the node as an appended
279
+ * child. A leaf target has no child slot, so the node lands as the leaf's
280
+ * next sibling in its own container instead, mirroring how a
281
+ * drag-and-drop side-drop resolves rather than nesting the node where it
282
+ * can never render.
283
+ */ resolveInsertTarget(target) {
284
+ var _this_getNodeParent, _ref;
285
+ var _parent_nodes;
286
+ const root = this.getNode(NODE_ROOT_ID);
287
+ const requested = typeof (target == null ? void 0 : target.$id) === 'string' && this.getNode(target.$id) || root;
288
+ if (this.nodeAcceptsChildren(requested)) {
289
+ return {
290
+ parent: requested,
291
+ index: NaN
292
+ };
293
+ }
294
+ const parent = (_this_getNodeParent = this.getNodeParent(requested)) != null ? _this_getNodeParent : root;
295
+ const at = (_ref = (_parent_nodes = parent.nodes) == null ? void 0 : _parent_nodes.indexOf(requested.$id)) != null ? _ref : -1;
296
+ return {
297
+ parent,
298
+ index: at < 0 ? NaN : at + 1
299
+ };
300
+ }
301
+ serializeNodes() {
302
+ const nodes = {};
303
+ this.nodes.forEach((node, id)=>{
304
+ nodes[id] = node.toJSON();
305
+ });
306
+ return nodes;
307
+ }
308
+ toJSON() {
309
+ return {
310
+ nodes: this.serializeNodes()
311
+ };
312
+ }
313
+ redo() {
314
+ return this.restoreSnapshot(this._history.redo(this._epoch));
315
+ }
316
+ undo() {
317
+ return this.restoreSnapshot(this._history.undo(this._epoch));
318
+ }
319
+ saveHistory() {
320
+ // Inside a batch, the snapshot the batch took is the step every mutation
321
+ // folds into — see `batch`.
322
+ if (this._batchDepth > 0) return this;
323
+ this._history.saveHistory(this._epoch);
324
+ return this;
325
+ }
326
+ /**
327
+ * Records that a REMOTE session changed `nodeId`, so a later local undo
328
+ * does not roll that change back (AGL-1958).
329
+ *
330
+ * Call this from the co-editing apply path for every node a peer creates,
331
+ * changes or deletes — including the delete, whose absence is as much a
332
+ * remote state as a value is.
333
+ *
334
+ * ## Why this is needed at all
335
+ *
336
+ * Applying a remote change deliberately does NOT record local history
337
+ * (AGL-677 rule 1), which keeps a colleague's edit out of your undo
338
+ * stack. That is necessary and it is not sufficient. Every entry already
339
+ * in the stack is a snapshot of the WHOLE document taken before one of
340
+ * your edits, and a colleague's later edit is by definition not in it. So
341
+ * an undo that replays such a snapshot wholesale reverts their node too,
342
+ * and — because the reverted map is then diffed against the co-editing
343
+ * shadow like any other local edit — publishes that revert back to them
344
+ * under YOUR session id. Their work is destroyed on their screen, with no
345
+ * signal and nothing that restores it.
346
+ *
347
+ * Measured before this fix: a peer's edit came back reverted, and a node
348
+ * the peer had CREATED was deleted outright.
349
+ *
350
+ * ## An apply that changed nothing is not a peer edit (AGL-2486)
351
+ *
352
+ * `previousJson` is the node's serialization from BEFORE the apply. When
353
+ * the apply left it byte-for-byte identical, this records nothing: no
354
+ * mark, no epoch bump. That is not an optimisation, it is the difference
355
+ * between a peer edit and an ECHO, and getting it wrong broke undo
356
+ * outright.
357
+ *
358
+ * The mirror is per node and every session in the room republishes what it
359
+ * holds, so a value you wrote can come back to you from ANOTHER SESSION —
360
+ * your own second tab most of all, which is ordinary once same-account
361
+ * sessions count as co-editors. The room already drops your own tab's
362
+ * echoes by session id, but not another session's echo of your value.
363
+ *
364
+ * Marking that echo is fatal because the mark is what {@link
365
+ * restoreSnapshot} reads. It lands with a FRESH epoch, therefore newer
366
+ * than every snapshot already on your stack, so the overlay puts the live
367
+ * value back over each one of them. Undo then consumed its entry and
368
+ * changed nothing at all — measured on the running editor, one account,
369
+ * two tabs on one screen: `past: 0, future: 1, canUndo: false`, the node
370
+ * still holding the edit that had just been undone.
371
+ *
372
+ * Note what this deliberately does NOT do: it does not ask whose session
373
+ * or whose account the change came from. A genuinely different value from
374
+ * your other tab is a real concurrent edit with its own undo stack and is
375
+ * protected like any other. "Foreign" keeps its one meaning — a session
376
+ * other than this tab moved this node — and the defect was counting a
377
+ * non-change as a change.
378
+ */ markRemoteNode(nodeId, previousJson) {
379
+ if (!nodeId) return this;
380
+ if (previousJson !== undefined) {
381
+ const live = this.nodes.get(nodeId);
382
+ const nowJson = live ? JSON.stringify(live.toJSON()) : undefined;
383
+ if (nowJson === previousJson) return this;
384
+ }
385
+ this._foreignAt.set(nodeId, ++this._epoch);
386
+ return this;
387
+ }
388
+ /**
389
+ * A node's serialization as it stands right now, for handing back to
390
+ * {@link markRemoteNode} after an apply — the "before" half of the echo
391
+ * test. `undefined` when the node is not in the map.
392
+ */ serializeNode(nodeId) {
393
+ const node = this.nodes.get(nodeId);
394
+ return node ? JSON.stringify(node.toJSON()) : undefined;
395
+ }
396
+ /**
397
+ * Restores a history snapshot, keeping every node a remote session has
398
+ * touched SINCE that snapshot was taken (AGL-1958).
399
+ *
400
+ * The epoch comparison is the whole mechanism, and it is what keeps undo
401
+ * honest rather than merely safe:
402
+ *
403
+ * * `foreignAt > snapshot.epoch` — the peer's change landed *after* this
404
+ * snapshot, so the snapshot predates it and would roll it back. Keep
405
+ * what is live now: the current value, or the node's absence when the
406
+ * peer deleted it.
407
+ * * `foreignAt <= snapshot.epoch` — the snapshot was taken after the
408
+ * peer's change and therefore already contains it. Restore it normally,
409
+ * or undo would stop rewinding your own edits to co-edited nodes.
410
+ *
411
+ * A node both you and a peer changed resolves to the peer's value, which
412
+ * is the same last-writer-wins rule the per-node mirror applies
413
+ * everywhere else (AGL-677) rather than a new one invented here.
414
+ *
415
+ * A peer that adds a child republishes the parent's child list, so the
416
+ * parent is marked too and its list survives with the child.
417
+ *
418
+ * ## Both directions, and why redo is not the special case it looks like
419
+ *
420
+ * This serves {@link redo} as well as {@link undo}, and the stamp is what
421
+ * makes that work rather than a second rule (AGL-2486). A `future` entry
422
+ * replays a state from before the undo, so the intuition is that it must
423
+ * predate any later peer change and roll it back. It does not:
424
+ * `HistoryManager.undo` captures the present and stamps it with the epoch
425
+ * AT THE TIME OF THE UNDO, so a peer change that lands between the undo
426
+ * and the redo is strictly newer than `snapshot.epoch` and is kept here —
427
+ * including a node the peer CREATED in that gap, which the `future` entry
428
+ * has no key for at all and a bare replace would broadcast as a delete.
429
+ */ restoreSnapshot(snapshot) {
430
+ const json = Object.fromEntries(snapshot.nodes.entries());
431
+ this.setNodes(this.withForeignNodes(json, snapshot.epoch));
432
+ return this;
433
+ }
434
+ /**
435
+ * Overlays the nodes a remote session has touched since `sinceEpoch` onto a
436
+ * map about to REPLACE the canvas — the current value, or the node's
437
+ * absence when the peer deleted it (AGL-1958).
438
+ *
439
+ * Shared by {@link restoreSnapshot} and {@link applyNodes} because it is
440
+ * one rule, not two: any wholesale replace composed without knowledge of a
441
+ * peer's change would otherwise roll that change back and — through the
442
+ * co-editing diff — publish the rollback to its author.
443
+ *
444
+ * Mutates and returns `json`; callers pass a map they own.
445
+ */ withForeignNodes(json, sinceEpoch) {
446
+ for (const [nodeId, at] of this._foreignAt){
447
+ if (at <= sinceEpoch) continue;
448
+ const live = this.nodes.get(nodeId);
449
+ if (live) json[nodeId] = live;
450
+ else delete json[nodeId];
451
+ }
452
+ return json;
453
+ }
454
+ /**
455
+ * Whether any REMOTE session has changed this canvas since it loaded
456
+ * (AGL-2486).
457
+ *
458
+ * The draft prompt reads it to decide whether offering a private
459
+ * per-browser snapshot back is still honest: once a colleague's live work
460
+ * is on the canvas, applying an older whole-document snapshot is not
461
+ * "restore my unsaved changes" but "roll the shared canvas back".
462
+ *
463
+ * `_epoch` only ever moves in {@link markRemoteNode}, so a non-zero epoch
464
+ * IS "a peer has touched this canvas", and {@link reset} returns it to zero
465
+ * with the rest of the session.
466
+ */ get hasRemoteEdits() {
467
+ return this._epoch > 0;
468
+ }
469
+ /**
470
+ * Runs `mutate` as one undoable step (AGL-1204).
471
+ *
472
+ * Every mutator on this class records history for itself, but a panel that
473
+ * writes `node.sx` directly does not go through any of them — the Styles and
474
+ * custom-CSS forms assign to the node, so an undo after a style change
475
+ * restored the last *recorded* snapshot instead, silently discarding
476
+ * everything done since. This is the seam those panels were missing.
477
+ *
478
+ * **`coalesceKey` is what makes it usable for a live-applying control.**
479
+ * Those forms fire on every change — one per character typed, one per drag
480
+ * tick of a slider — so recording unconditionally would replace "undo does
481
+ * not step back far enough" with "undo steps back one character", which is
482
+ * no better. Consecutive calls sharing a key inside {@link
483
+ * COALESCE_WINDOW_MS} record **once**, at the start of the burst, so the
484
+ * snapshot is the state *before* the adjustment began. Omit the key for a
485
+ * discrete commit (a toggle, an Apply button) that deserves its own step.
486
+ *
487
+ * The window is evaluated on call rather than by a timer: a burst ends
488
+ * because the next edit arrives late, not because something fired in the
489
+ * background. That keeps the canvas free of pending timers it would have to
490
+ * cancel on {@link reset}, and keeps this testable without fake clocks.
491
+ *
492
+ * The key should identify *what* is being adjusted, not just the node —
493
+ * moving from Gap to Padding is a second adjustment even if it happens
494
+ * within the window.
495
+ */ transact(mutate, coalesceKey) {
496
+ const now = Date.now();
497
+ const burst = this._coalescing;
498
+ const continues = coalesceKey !== undefined && (burst == null ? void 0 : burst.key) === coalesceKey && now - burst.at < CanvasManager.COALESCE_WINDOW_MS;
499
+ if (!continues) this.saveHistory();
500
+ this._coalescing = coalesceKey === undefined ? undefined : {
501
+ key: coalesceKey,
502
+ at: now
503
+ };
504
+ return mutate();
505
+ }
506
+ /**
507
+ * Runs several mutations as ONE undoable step, all or nothing.
508
+ *
509
+ * `transact` records one snapshot and then runs code that assigns to nodes
510
+ * directly. That is right for a panel writing `node.sx`, and wrong for a
511
+ * caller that composes the guarded mutators — `addNodeFromNested`,
512
+ * `updateNodeProps`, `reparentNode`, `deleteNode` — because each of those
513
+ * records its own step. A change made of five of them would take five
514
+ * undos to take back, and an undo that stops part-way leaves the document
515
+ * in a state nobody authored.
516
+ *
517
+ * So inside a batch the mutators keep every guard and record nothing: the
518
+ * batch's own snapshot, taken before `mutate` runs, is the step. A nested
519
+ * batch folds into the outer one.
520
+ *
521
+ * A mutation that throws — a guard refusing a stale parent, a move into
522
+ * the node's own subtree — rolls the whole batch back to that snapshot
523
+ * and removes the snapshot from both stacks before the error propagates.
524
+ * Half a batch is not an edit anyone asked for, and a refused batch must
525
+ * not leave an undo step that restores a state identical to the present.
526
+ */ batch(mutate) {
527
+ if (this._batchDepth > 0) return mutate();
528
+ this._history.saveHistory(this._epoch);
529
+ // Whatever burst was open described the state before this batch.
530
+ this._coalescing = undefined;
531
+ this._batchDepth += 1;
532
+ let completed = false;
533
+ try {
534
+ const result = mutate();
535
+ completed = true;
536
+ return result;
537
+ } finally{
538
+ this._batchDepth -= 1;
539
+ // `canUndo` is only false when `mutate` itself cleared the history,
540
+ // and then there is no snapshot left to roll back to.
541
+ if (!completed && this._history.canUndo) {
542
+ this.restoreSnapshot(this._history.undo(this._epoch));
543
+ this._history.clearFuture();
544
+ }
545
+ }
546
+ }
547
+ /**
548
+ * Drops BOTH history stacks and any open {@link transact} burst.
549
+ *
550
+ * Both, deliberately (AGL-2486). This used to clear `past` alone, which
551
+ * left a caller that had just "cleared history" holding a live redo stack
552
+ * — `canRedo` still true, still offering a snapshot of the state before
553
+ * the clear. `reset` was the only caller and compensated for it a line
554
+ * later, which is exactly how the next caller inherits the trap.
555
+ *
556
+ * A stale redo is worse than a stale undo in a co-editing session: redo
557
+ * replays a WHOLE-DOCUMENT snapshot, and the restored map is diffed
558
+ * against the co-editing shadow and published, so every node the snapshot
559
+ * does not have goes out as a delete under this session's id.
560
+ */ clearHistory() {
561
+ this._history.clearHistory();
562
+ this._coalescing = undefined;
563
+ }
564
+ createNodeId() {
565
+ return createIdUrlSafe();
566
+ }
567
+ createNode(schema) {
568
+ return new AglynNode(_extends({}, schema, {
569
+ $id: (schema == null ? void 0 : schema.$id) || this.createNodeId()
570
+ }), this);
571
+ }
572
+ clearNodes() {
573
+ this.nodes.clear();
574
+ return this;
575
+ }
576
+ /**
577
+ * Returns the canvas to its pristine state (no nodes, no history, no
578
+ * recorded initial snapshot). The canvas is an app-level singleton shared
579
+ * by every editing session — call this when a session ends so the next
580
+ * document doesn't inherit stale content.
581
+ */ reset() {
582
+ this.clearNodes();
583
+ this.clearHistory();
584
+ this._initial = undefined;
585
+ this._initialConfirmed = true;
586
+ // A new document gets a new epoch line. Stale marks would otherwise
587
+ // preserve node ids that mean something else here (AGL-1958).
588
+ this._foreignAt.clear();
589
+ this._epoch = 0;
590
+ return this;
591
+ }
592
+ /**
593
+ * Record the state the canvas should be considered saved against.
594
+ *
595
+ * `confirmed` is what makes this honest. Pass `false` when the map came
596
+ * from a source the STORE has not acknowledged — a Firestore snapshot
597
+ * carrying this client's own pending write is the case that motivated it
598
+ * (AGL-1262): the document is loaded and must be shown, but nothing in it
599
+ * is known to have reached the server, so it must not be adopted as
600
+ * "already saved". An unconfirmed baseline keeps {@link isInitialSame}
601
+ * false — the editor stays savable — until a real save records a
602
+ * confirmed one.
603
+ */ updateInitialNodes(nodes, options) {
604
+ var _ref;
605
+ this._initial = nodes ? toJS(nodes) : this.serializeNodes();
606
+ this._initialConfirmed = (_ref = options == null ? void 0 : options.confirmed) != null ? _ref : true;
607
+ return this;
608
+ }
609
+ /**
610
+ * Promote an UNCONFIRMED baseline to a confirmed one, once the store has
611
+ * acknowledged the write that made it unconfirmed (AGL-2486).
612
+ *
613
+ * Without this there is no way back. `_initialConfirmed` moves to true in
614
+ * only two other places — {@link reset} and {@link updateInitialNodes} —
615
+ * and the editor records its baseline exactly once, on the first snapshot
616
+ * that carries nodes. A document whose first snapshot happens to carry
617
+ * this client's own queued write therefore reads dirty for the rest of the
618
+ * session over content nobody has edited.
619
+ *
620
+ * Conditional on the canvas still MATCHING the baseline, which is what
621
+ * keeps AGL-1262 intact. The acknowledgement is for the write that was in
622
+ * flight, and says nothing about work the author has done since; adopting
623
+ * a canvas that has moved on would call that work saved and take away the
624
+ * only control that could still write it.
625
+ *
626
+ * @returns whether the baseline is confirmed as a result.
627
+ */ confirmInitialNodes() {
628
+ if (!this._initial) return false;
629
+ if (this._initialConfirmed) return true;
630
+ if (!isEqual(this._initial, this.serializeNodes())) return false;
631
+ this._initialConfirmed = true;
632
+ return true;
633
+ }
634
+ /**
635
+ * Registers a node in the map AND lists it on `parent`, in one action
636
+ * (AGL-1366).
637
+ *
638
+ * `parent` is required, and that is the whole point: this was the last way
639
+ * left to put an entry in `this.nodes` with no parent linkage at all. The
640
+ * besigner saves a flat map and renders a tree — `serializeNodes` dumps
641
+ * every entry in the map while the renderer walks child lists down from
642
+ * `NODE_ROOT_ID` — so a node the map holds and no parent lists is not a
643
+ * rendering glitch that a reload clears. It is saved on every save,
644
+ * shipped in every payload, counted against the 1 MiB ceiling, and never
645
+ * drawn. That is the mechanism behind the 61 unreachable nodes `/product`
646
+ * served, 26 of them carrying the only copy of two Hero sections' text
647
+ * (AGL-1363).
648
+ *
649
+ * An *optional* parent would not have closed it, because the caller who
650
+ * omits it is precisely the caller who creates the orphan. So the linkage
651
+ * is not a second step a caller may forget — it happens here, and the
652
+ * parent is resolved through `getNode($id)` and throws on a miss: the same
653
+ * guard `addNodeFromNested` has carried since AGL-537 and `reparentNode`
654
+ * took on in AGL-1363, rather than a second mechanism. A stale instance a
655
+ * panel closure kept across a co-editor's merge, or a parent a peer has
656
+ * since deleted, therefore fails loud instead of stranding the node.
657
+ *
658
+ * Linking is idempotent: re-setting a node its parent already lists
659
+ * replaces the map entry and leaves the child list untouched, so this
660
+ * stays usable as an update.
661
+ *
662
+ * The root is refused outright — it has no parent to be listed on, and
663
+ * seeding it belongs to `setNodes`, which alone keeps its canonical id.
664
+ */ setNode(node, parent, index = NaN, create = false) {
665
+ if (!node) throw new Error('Invalid node');
666
+ if (!create && !node.$id) throw new Error('Invalid node id');
667
+ if (this.isRootNode(node)) throw new Error('Cannot set root node');
668
+ // Resolve through the LIVE map BEFORE anything is inserted, so a refused
669
+ // call leaves the canvas exactly as it found it.
670
+ const parentId = typeof parent === 'string' ? parent : parent == null ? void 0 : parent.$id;
671
+ const target = parentId != null ? this.getNode(parentId) : undefined;
672
+ if (!target) throw new Error('Invalid parent node');
673
+ return runInAction(()=>{
674
+ const _node = create ? this.createNode(node) : node;
675
+ // Both directions of the link are set here; a `parentId` disagreeing
676
+ // with the list that holds the id is the same orphan by another route.
677
+ _node.parentId = target.$id;
678
+ this.nodes.set(_node.$id, _node);
679
+ // Read-back, not `(target.nodes ||= []).push()` — see reparentNode
680
+ // (AGL-763): the `||=` value is the detached plain array on an
681
+ // observable.
682
+ if (!target.nodes) target.nodes = [];
683
+ if (!target.nodes.includes(_node.$id)) {
684
+ if (isNaN(index)) target.nodes.push(_node.$id);
685
+ else target.nodes.splice(index, 0, _node.$id);
686
+ }
687
+ return this.nodes.get(_node.$id);
688
+ });
689
+ }
690
+ setNodes(schemas, merge = false) {
691
+ if (!schemas) throw new Error('Invalid schemas');
692
+ // Replacing the map ends any open {@link transact} burst (AGL-1204).
693
+ // This is the seam a co-editor's incoming change arrives through, and
694
+ // the one an undo restores through: in both cases the state the open
695
+ // burst snapshotted is no longer the state the next edit is adjusting,
696
+ // so the next edit must record its own step rather than fold into it.
697
+ this._coalescing = undefined;
698
+ const cloned = toJS(schemas);
699
+ const nodes = {};
700
+ for(const nodeId in cloned){
701
+ var _node_$id;
702
+ const node = cloned[nodeId];
703
+ if (!node) continue;
704
+ // Persisted maps key nodes by id. Early seeds omitted $id (which used
705
+ // to mint a random one), and the root must always keep the canonical
706
+ // id — the map key is authoritative.
707
+ const $id = nodeId === NODE_ROOT_ID ? NODE_ROOT_ID : (_node_$id = node.$id) != null ? _node_$id : nodeId;
708
+ nodes[nodeId] = this.createNode(_extends({}, node, {
709
+ $id
710
+ }));
711
+ }
712
+ if (merge) {
713
+ this.nodes.merge(nodes);
714
+ } else {
715
+ this.nodes.replace(nodes);
716
+ }
717
+ return this;
718
+ }
719
+ /**
720
+ * Replaces the whole node map with a map the USER supplied — the raw-JSON
721
+ * editor, and the local draft the crash net offers back (AGL-2486).
722
+ *
723
+ * Snapshots first, so the replacement is undoable — unlike `setNodes`,
724
+ * which also serves the history-restore and initial-load paths.
725
+ *
726
+ * **Every node a remote session has touched survives it**, on exactly the
727
+ * reasoning AGL-1958 established for undo. A wholesale replace is the same
728
+ * shape of write as a snapshot restore: the map being applied was composed
729
+ * without any knowledge of the peer's later changes, and the result is
730
+ * diffed against the co-editing shadow and published, so a node the map
731
+ * happens to lack is broadcast as a DELETE under this session's id.
732
+ * Measured on the running editor before this changed (AGL-2486): a peer
733
+ * created a node, the other session pressed Restore, and the node vanished
734
+ * from the peer's own canvas with an RTDB tombstone to show for it.
735
+ *
736
+ * Every mark counts, not only those newer than some epoch: unlike a
737
+ * snapshot, an applied map carries no epoch of its own, and a draft was by
738
+ * definition composed before this page joined the room.
739
+ */ applyNodes(value) {
740
+ this.saveHistory();
741
+ const parsed = this.processNodesToDenormalized(value);
742
+ return this.setNodes(this.withForeignNodes(_extends({}, parsed), 0));
743
+ }
744
+ deleteNode(node) {
745
+ const validateNode = (node)=>{
746
+ if (!node || !(node == null ? void 0 : node.$id) || !(node == null ? void 0 : node.parentId)) throw new Error('Invalid node');
747
+ if (this.isRootNode(node)) throw new Error('Cannot delete root node');
748
+ };
749
+ validateNode(node);
750
+ this.saveHistory();
751
+ const del = (node)=>{
752
+ var _ref;
753
+ var _parent_nodes, _parent_nodes1;
754
+ validateNode(node);
755
+ const parent = this.getNode(node.parentId);
756
+ if (!parent) throw new Error('Invalid parent node');
757
+ const index = (_ref = (_parent_nodes = parent.nodes) == null ? void 0 : _parent_nodes.indexOf(node.$id)) != null ? _ref : -1;
758
+ const nodes = toJS(node.nodes || []);
759
+ for (const childId of [
760
+ ...nodes
761
+ ]){
762
+ const child = this.getNode(childId);
763
+ if (child) del(child);
764
+ }
765
+ if (index > -1) (_parent_nodes1 = parent.nodes) == null ? void 0 : _parent_nodes1.splice(index, 1);
766
+ this.nodes.delete(node.$id);
767
+ };
768
+ del(node);
769
+ return this;
770
+ }
771
+ /**
772
+ * Moves a node under `newParent`, resolving BOTH ends through the live
773
+ * node map first (AGL-1363).
774
+ *
775
+ * The resolution is the guard, and it is the same one `addNodeFromNested`
776
+ * has carried since AGL-537. This method splices the node out of its
777
+ * *live* old parent and then attaches it to the object it was handed — so
778
+ * a `newParent` that is merely SHAPED like a node (a stale instance a
779
+ * panel closure kept across a co-editor's merge, a node a peer has since
780
+ * deleted, historically a click event) took the node out of the tree and
781
+ * pushed its id onto a detached array. Nothing put it back.
782
+ *
783
+ * That is not a recoverable glitch: `serializeNodes` dumps the whole map
784
+ * while the renderer walks the tree from `NODE_ROOT_ID`, so a node in the
785
+ * map that no live parent lists is saved on every save, shipped in every
786
+ * payload, counted against the 1 MiB ceiling — and never drawn. It is why
787
+ * `/product` served 61 unreachable nodes, 26 of them carrying the only
788
+ * copy of two Hero sections' text. Fail loud instead.
789
+ *
790
+ * `index` is the node's position in the resulting sibling list — i.e. it is
791
+ * read AFTER the node has been spliced out of wherever it was. A caller
792
+ * holding a drop marker ("put it before the sibling currently at 3") is
793
+ * describing the list BEFORE the removal and has to convert; the dnd
794
+ * manager does exactly that for same-parent drops.
795
+ */ reparentNode(node, newParent, index = NaN) {
796
+ var _ref;
797
+ var _oldParent_nodes, _oldParent_nodes1;
798
+ if (!node) throw new Error('Invalid node');
799
+ if (this.isRootNode(node)) throw new Error('Cannot move root node');
800
+ if (!newParent) throw new Error('Invalid parent node');
801
+ // Every refusal below runs before `saveHistory`: a move that never
802
+ // happened must not leave an undo step behind it.
803
+ const target = node.$id != null ? this.getNode(node.$id) : undefined;
804
+ if (!target) throw new Error('Invalid node');
805
+ const parent = newParent.$id != null ? this.getNode(newParent.$id) : undefined;
806
+ if (!parent) throw new Error('Invalid parent node');
807
+ const oldParent = this.getNodeParent(target);
808
+ const oldIndex = (_ref = oldParent == null ? void 0 : (_oldParent_nodes = oldParent.nodes) == null ? void 0 : _oldParent_nodes.indexOf(target.$id)) != null ? _ref : -1;
809
+ const sameParent = (oldParent == null ? void 0 : oldParent.$id) === parent.$id;
810
+ if (!sameParent) {
811
+ var _this_getNodeBreadcrumbPath;
812
+ // A node into its own subtree detaches that subtree from the document
813
+ // and hands the renderer a cycle. `breadcrumbPath` is the ancestor
814
+ // chain, so the target appearing in the new parent's is the whole test
815
+ // — and it covers `parent === target` on its own.
816
+ if ((_this_getNodeBreadcrumbPath = this.getNodeBreadcrumbPath(parent)) == null ? void 0 : _this_getNodeBreadcrumbPath.some((id)=>id === target.$id)) {
817
+ throw new Error('Cannot move an element inside itself');
818
+ }
819
+ /**
820
+ * The gate that was missing (AGL-1405). `nodeAcceptsChildren` guarded
821
+ * every path that CREATES a node — the Insert menu and paste through
822
+ * `resolveInsertTarget`, drag-and-drop through the dnd manager — but
823
+ * not the one that MOVES one. So a `markdown` block (or any component
824
+ * whose content is an attribute: a Reusable Component instance, a
825
+ * Layout Slot, a List Item Text) could still be handed a child, which
826
+ * it then renders nowhere. That is not a cosmetic mistake: the node is
827
+ * saved on every save and shipped in every payload while the page it
828
+ * belongs to shows nothing, so the work reads as never done rather
829
+ * than broken. Three /press screenshots are still sitting in exactly
830
+ * that hole, and the point of the click-path this guard protects is
831
+ * that it must not be able to dig another one.
832
+ *
833
+ * A same-parent reorder is deliberately NOT gated: the nodes already
834
+ * trapped by AGL-1388 have to stay shufflable, and `reorderNode`
835
+ * routes Shift up / Shift down straight through here.
836
+ */ // Deliberately label-free: `getNodeLabelShort` reaches into the
837
+ // component registry, and a refusal path that can itself throw is no
838
+ // refusal at all. Callers that want "Markdown can't hold elements"
839
+ // name the node themselves — `moveNodeOut`/`moveNodeIn` do.
840
+ if (!this.nodeAcceptsChildren(parent)) {
841
+ throw new Error('That element cannot hold other elements');
842
+ }
843
+ }
844
+ // Assign then read back, never `(x.nodes ||= []).push()` (AGL-763). A
845
+ // live node is a `makeAutoObservable` proxy: assigning a fresh `[]` stores
846
+ // an observable copy, but the `||=` expression evaluates to the plain
847
+ // array that was assigned — so pushing onto it writes to a detached array
848
+ // and the child silently orphans. `AglynNode`'s constructor seeds `nodes`
849
+ // so this never actually fires today, but relying on that invariant from
850
+ // here is how the same defect returned as AGL-759.
851
+ if (!parent.nodes) parent.nodes = [];
852
+ // Resolve the landing slot against the list as it will be AFTER the
853
+ // removal, and clamp it. `splice(-1, 0, id)` inserts before the LAST
854
+ // element, so an unclamped negative index moved a first child DOWN —
855
+ // `reorderNode(node, node.index - 1)` on index 0 did precisely that, and
856
+ // only the menu's `disabled` prop hid it.
857
+ const settled = parent.nodes.length - (sameParent && oldIndex > -1 ? 1 : 0);
858
+ const at = isNaN(index) ? settled : Math.min(Math.max(index, 0), settled);
859
+ // A move that resolves to the slot the node already occupies is not a
860
+ // move. It used to cost an undo step anyway — which is how a hierarchy
861
+ // drag came to "record an undo entry without moving anything" (AGL-1405),
862
+ // and worse, made the next Undo discard the author's PREVIOUS edit.
863
+ if (sameParent && at === oldIndex) return target;
864
+ this.saveHistory();
865
+ if (oldIndex > -1) oldParent == null ? void 0 : (_oldParent_nodes1 = oldParent.nodes) == null ? void 0 : _oldParent_nodes1.splice(oldIndex, 1);
866
+ if (!sameParent) target.parentId = parent.$id;
867
+ parent.nodes.splice(at, 0, target.$id);
868
+ return target;
869
+ }
870
+ reorderNode(node, index = NaN) {
871
+ if (!node) throw new Error('Invalid node');
872
+ // Resolve the node first, so the parent is read off the LIVE node's
873
+ // `parentId` rather than a stale copy's (AGL-1363).
874
+ const target = node.$id != null ? this.getNode(node.$id) : undefined;
875
+ if (!target) throw new Error('Invalid node');
876
+ const parent = this.getNodeParent(target);
877
+ if (!parent) throw new Error('Invalid parent node');
878
+ return this.reparentNode(target, parent, index);
879
+ }
880
+ duplicateNode(node) {
881
+ var _ref;
882
+ var _parent_nodes;
883
+ if (!node) throw new Error('Invalid node');
884
+ if (this.isRootNode(node)) throw new Error('Cannot duplicate root node');
885
+ const parent = this.getNodeParent(node);
886
+ if (!parent) throw new Error('Invalid parent node');
887
+ const duplicateNodeAndChildren = (node, parentId, index = NaN)=>{
888
+ if (!node) throw new Error('Invalid node');
889
+ const json = toJS(node);
890
+ // `setNode` registers the copy AND lists it on its parent, so no copy
891
+ // can be left in the map unreferenced — the linkage is no longer a
892
+ // separate step this recursion could get wrong (AGL-1366).
893
+ const newNode = this.setNode(this.createNode(_extends({}, json, {
894
+ $id: this.createNodeId(),
895
+ parentId,
896
+ nodes: []
897
+ })), parentId, index);
898
+ if (!json) return newNode;
899
+ for (const childId of arraySafe(json.nodes)){
900
+ const child = childId && this.getNode(childId);
901
+ if (child) duplicateNodeAndChildren(child, newNode.$id);
902
+ }
903
+ return newNode;
904
+ };
905
+ this.saveHistory();
906
+ const nodeIndex = this.getNodeIndex(node);
907
+ const index = nodeIndex === -1 ? (_ref = (_parent_nodes = parent.nodes) == null ? void 0 : _parent_nodes.length) != null ? _ref : 0 : nodeIndex + 1;
908
+ // One action, so observers never see the copy listed on its parent
909
+ // before its own subtree has been built under it.
910
+ return runInAction(()=>duplicateNodeAndChildren(node, node.parentId, index));
911
+ }
912
+ createDuplicateNode(node) {
913
+ const $id = this.createNodeId();
914
+ const cloned = toJS(node);
915
+ const nodes = Array.isArray(cloned == null ? void 0 : cloned.nodes) ? [
916
+ ...cloned.nodes
917
+ ] : [];
918
+ const res = _extends({}, cloned, {
919
+ $id,
920
+ nodes: []
921
+ });
922
+ for (const child of nodes){
923
+ const childDuplicate = this.createDuplicateNode(_extends({}, child, {
924
+ parentId: $id
925
+ }));
926
+ res.nodes.push(childDuplicate);
927
+ }
928
+ return res;
929
+ }
930
+ /**
931
+ * Insert a *detached* nested subtree as a child of `parent`, minting a
932
+ * fresh id for every node in it (AGL-1202).
933
+ *
934
+ * The subtree is plain JSON with no ties to this canvas, so the source can
935
+ * be anything — an element preset, the besigner clipboard, or a subtree
936
+ * copied out of a different document altogether. Callers are responsible
937
+ * for checking that the root's component is registered and that the
938
+ * lineal relationship with `parent` is allowed; this method only does the
939
+ * structural work.
940
+ */ addNodeFromNested(nested, parent, index = NaN) {
941
+ if (!nested) throw new Error('Invalid node');
942
+ // Attach to the live node in this canvas. A caller-supplied object
943
+ // that is not in the node map (a stale reference — or historically the
944
+ // console INSERT menu's click event) would otherwise get the child id
945
+ // pushed onto ITS `nodes` array while the child lands in the map as a
946
+ // detached node: absent from the hierarchy, the canvas, and saves
947
+ // (AGL-537). Fail loud instead of corrupting the tree.
948
+ const target = (parent == null ? void 0 : parent.$id) != null ? this.getNode(parent.$id) : undefined;
949
+ if (!target) throw new Error('Invalid parent node');
950
+ this.saveHistory();
951
+ const duplicate = this.createDuplicateNode(nested);
952
+ duplicate.parentId = target.$id;
953
+ const parsed = this.processNodesToDenormalized(duplicate);
954
+ // Register the subtree and append the child id in one action so
955
+ // observers never see the intermediate detached state.
956
+ runInAction(()=>{
957
+ this.setNodes(parsed, true);
958
+ // Read-back, not `(target.nodes ||= []).push()` — see reparentNode
959
+ // (AGL-763): the `||=` value is the detached plain array on an observable.
960
+ if (!target.nodes) target.nodes = [];
961
+ if (isNaN(index)) target.nodes.push(duplicate.$id);
962
+ else target.nodes.splice(index, 0, duplicate.$id);
963
+ });
964
+ return this.getNode(duplicate.$id);
965
+ }
966
+ addNodeFromPreset(preset, parent, index = NaN) {
967
+ if (!preset) throw new Error('Invalid preset');
968
+ return this.addNodeFromNested(toJS(preset).data, parent, index);
969
+ }
970
+ /**
971
+ * REPLACES a node's props — callers spread the current ones to merge.
972
+ *
973
+ * An editor form submits every field it renders, so keys the author left
974
+ * empty arrive as `undefined`. Those are dropped here rather than stored as
975
+ * own keys (AGL-1334): for a props bag that is REPLACED wholesale, absent IS
976
+ * cleared, and an `undefined` member is a value no storage layer accepts.
977
+ * `AglynNode.toJSON` strips again at the write boundary — this one keeps the
978
+ * live tree honest for everything that reads it before a save.
979
+ */ /**
980
+ * Writes top-level node FIELDS, with an undo step.
981
+ *
982
+ * The sibling of {@link updateNodeProps}, and it exists for the same two
983
+ * reasons that one documents. An edit with no `saveHistory` is an edit the
984
+ * author cannot take back — and every panel that assigned to a node
985
+ * directly was quietly in that state. And it re-resolves by `$id`: callers
986
+ * hold node objects across time (the focus store keeps the selection that
987
+ * way), while every wholesale replace of the map — `undo`, `redo`,
988
+ * `applyNodes`, a draft restore — builds fresh instances. Assigning to the
989
+ * caller's copy then mutates an orphan: no error, no dirty state, and the
990
+ * author's edit is simply gone.
991
+ *
992
+ * Only the keys the patch names are touched, and `undefined` clears one —
993
+ * which is how a cleared style or a shown element is stored, since `toJSON`
994
+ * omits what is undefined.
995
+ */ updateNodeFields(node, patch) {
996
+ var _this_getNode;
997
+ if (!node) throw new Error('Invalid node');
998
+ this.saveHistory();
999
+ const target = (_this_getNode = this.getNode(node.$id)) != null ? _this_getNode : node;
1000
+ Object.assign(target, patch);
1001
+ }
1002
+ updateNodeProps(node, props) {
1003
+ var _this_getNode;
1004
+ if (!node) throw new Error('Invalid node');
1005
+ this.saveHistory();
1006
+ // Write to the node the MAP holds, not the reference the caller kept
1007
+ // (AGL-2486). Callers hold node objects across time — the besigner's
1008
+ // focus store keeps the selection that way — and every wholesale replace
1009
+ // of the map (`undo`, `redo`, `applyNodes`, a draft restore) builds fresh
1010
+ // instances. Assigning to the caller's copy then mutates an orphan: no
1011
+ // error, no dirty state, and the author's edit is simply gone. Re-resolve
1012
+ // by `$id` so the write always reaches the canvas.
1013
+ //
1014
+ // The fallback keeps a node that is genuinely not in the map — deleted,
1015
+ // or never inserted — behaving as before rather than being resurrected.
1016
+ const target = (_this_getNode = this.getNode(node.$id)) != null ? _this_getNode : node;
1017
+ target.props = stripUndefinedDeep(_extends({}, props));
1018
+ }
1019
+ static nestDenormalizedNodes(nodes, rootId = NODE_ROOT_ID) {
1020
+ var _rootNode_nodes;
1021
+ const rootNode = nodes[rootId];
1022
+ if (!rootNode) throw new Error('Invalid root node');
1023
+ const response = _extends({}, rootNode);
1024
+ const children = [];
1025
+ // `?? []`, not `||= []` — a read-only walk should not mutate its input
1026
+ // (AGL-763).
1027
+ for (const id of (_rootNode_nodes = rootNode.nodes) != null ? _rootNode_nodes : []){
1028
+ const child = _extends({}, nodes[id]);
1029
+ const nestedChild = this.nestDenormalizedNodes(nodes, child.$id);
1030
+ children.push(nestedChild);
1031
+ }
1032
+ response.nodes = children;
1033
+ return response;
1034
+ }
1035
+ denormalizeNodes(nodes, parentId, accumulator = {}) {
1036
+ return CanvasManager.denormalizeNodes(nodes, parentId, accumulator);
1037
+ }
1038
+ static denormalizeNodes(nodes, parentId, accumulator = {}) {
1039
+ for (const childNode of Array.isArray(nodes) ? nodes : []){
1040
+ const child = _isStrT(childNode) && accumulator[childNode] ? accumulator[childNode] : childNode;
1041
+ if (!_isObj(child)) continue;
1042
+ const node = cloneDeep(child);
1043
+ // TODO: Remove after migration to nodes property
1044
+ if (node['elements']) {
1045
+ node.nodes = node['elements'];
1046
+ delete node['elements'];
1047
+ }
1048
+ // TODO: Remove after migration to pluginId property
1049
+ if (node['bundleId']) {
1050
+ node.pluginId = node['bundleId'];
1051
+ delete node['bundleId'];
1052
+ }
1053
+ const nodes = node == null ? void 0 : node.nodes;
1054
+ const nodesArray = [
1055
+ ...Array.isArray(nodes) ? nodes : []
1056
+ ].filter(Boolean);
1057
+ accumulator[node.$id] = _extends({}, node, {
1058
+ parentId,
1059
+ nodes: [
1060
+ ...nodesArray
1061
+ ].map((i)=>{
1062
+ if (_isStrT(i)) return i;
1063
+ if (_isObj(i)) return i.$id;
1064
+ return null;
1065
+ }).filter(Boolean)
1066
+ });
1067
+ this.denormalizeNodes(nodesArray, node.$id, accumulator);
1068
+ }
1069
+ return accumulator;
1070
+ }
1071
+ processNodesToDenormalized(value) {
1072
+ return CanvasManager.processNodesToDenormalized(value);
1073
+ }
1074
+ static processNodesToDenormalized(value) {
1075
+ let response = {};
1076
+ const isArray = Array.isArray(value);
1077
+ if (isArray && value.length === 1) {
1078
+ const item = value[0];
1079
+ if ((item == null ? void 0 : item.$id) === NODE_ROOT_ID) {
1080
+ response = this.denormalizeNodes([
1081
+ _extends({}, item, {
1082
+ parentId: null
1083
+ })
1084
+ ], NODE_ROOT_ID, response);
1085
+ } else if ((item == null ? void 0 : item.parentId) === NODE_ROOT_ID || item && item.parentId) {
1086
+ response = this.denormalizeNodes([
1087
+ {
1088
+ $id: NODE_ROOT_ID,
1089
+ componentId: 'div',
1090
+ nodes: [
1091
+ item
1092
+ ]
1093
+ }
1094
+ ], NODE_ROOT_ID, response);
1095
+ } else if (item == null ? void 0 : item.parentId) {
1096
+ response = this.denormalizeNodes([
1097
+ {
1098
+ $id: item == null ? void 0 : item.parentId,
1099
+ componentId: 'div',
1100
+ nodes: [
1101
+ item
1102
+ ]
1103
+ }
1104
+ ], item == null ? void 0 : item.parentId, response);
1105
+ } else {
1106
+ response = this.denormalizeNodes([
1107
+ {
1108
+ $id: NODE_ROOT_ID,
1109
+ componentId: 'div',
1110
+ nodes: []
1111
+ }
1112
+ ], NODE_ROOT_ID, response);
1113
+ }
1114
+ } else if (isArray) {
1115
+ response = this.denormalizeNodes([
1116
+ {
1117
+ $id: NODE_ROOT_ID,
1118
+ componentId: 'div',
1119
+ nodes: [
1120
+ ...value
1121
+ ]
1122
+ }
1123
+ ], NODE_ROOT_ID, response);
1124
+ } else if (_isObj(value) && Array.isArray(value == null ? void 0 : value.nodes) && typeof value.nodes[0] !== 'string') {
1125
+ const _value = _extends({}, value);
1126
+ response = this.denormalizeNodes([
1127
+ _value
1128
+ ], (_value == null ? void 0 : _value.parentId) || NODE_ROOT_ID, response);
1129
+ } else {
1130
+ response = value;
1131
+ }
1132
+ return response;
1133
+ }
1134
+ constructor(aglyn){
1135
+ this.aglyn = aglyn;
1136
+ this._initial = undefined;
1137
+ /**
1138
+ * Whether {@link _initial} is a state the STORE has confirmed, or merely
1139
+ * one the client believes. See {@link updateInitialNodes}.
1140
+ */ this._initialConfirmed = true;
1141
+ /** The open {@link transact} burst, if any. See that method. */ this._coalescing = undefined;
1142
+ /** How deep the running {@link batch} calls are nested; 0 outside one. */ this._batchDepth = 0;
1143
+ /**
1144
+ * Monotonic counter, bumped once per node a REMOTE session changes. See
1145
+ * {@link markRemoteNode} and {@link restoreSnapshot} (AGL-1958).
1146
+ */ this._epoch = 0;
1147
+ /** Node id → the {@link _epoch} at which a remote session last touched it. */ this._foreignAt = new Map();
1148
+ this.hasNode = computedFn(($id)=>{
1149
+ return this.nodes.has($id);
1150
+ });
1151
+ this.getNode = computedFn(($id)=>{
1152
+ if (!$id) return;
1153
+ return this.nodes.get($id);
1154
+ });
1155
+ this.nodesAreEqual = computedFn((left, right)=>{
1156
+ const _right = right ? right : this.nodes;
1157
+ return isEqual(toJS(left), toJS(_right));
1158
+ });
1159
+ this.getNodeParent = computedFn((node)=>{
1160
+ if (!node) throw new Error('Invalid node');
1161
+ if (!node.parentId) return;
1162
+ return this.getNode(node.parentId);
1163
+ });
1164
+ this.getNodeIndex = computedFn((node)=>{
1165
+ var _ref;
1166
+ var _parent_nodes;
1167
+ if (!node || !node.$id) throw new Error('Invalid node');
1168
+ const parent = this.getNodeParent(node);
1169
+ if (!parent) throw new Error('Invalid parent node');
1170
+ return (_ref = (_parent_nodes = parent.nodes) == null ? void 0 : _parent_nodes.indexOf(node.$id)) != null ? _ref : -1;
1171
+ });
1172
+ this.isRootNodeId = computedFn((id)=>{
1173
+ return id === NODE_ROOT_ID;
1174
+ });
1175
+ this.isRootNode = computedFn((node)=>{
1176
+ return (node == null ? void 0 : node.$id) === NODE_ROOT_ID;
1177
+ });
1178
+ this.getNodeBreadcrumbPath = computedFn((nodeOrId)=>{
1179
+ const hierarchy = [
1180
+ NODE_ROOT_ID
1181
+ ];
1182
+ // Visited ids, not just the root check: the root terminates the walk on
1183
+ // a well-formed document, but two nodes that parent each other
1184
+ // terminate nothing. An unbounded ancestor walk is a synchronous
1185
+ // infinite loop on the renderer's main thread — the tab stops answering
1186
+ // input entirely — so a malformed tree has to cost a truncated
1187
+ // breadcrumb instead.
1188
+ const seen = new Set();
1189
+ let currentId = typeof nodeOrId !== 'string' ? nodeOrId == null ? void 0 : nodeOrId.$id : nodeOrId;
1190
+ while(currentId && !this.isRootNodeId(currentId) && !seen.has(currentId)){
1191
+ var _this_getNode;
1192
+ seen.add(currentId);
1193
+ hierarchy.splice(1, 0, currentId);
1194
+ currentId = (_this_getNode = this.getNode(currentId)) == null ? void 0 : _this_getNode.parentId;
1195
+ }
1196
+ return hierarchy;
1197
+ });
1198
+ this.getNodeLabelShort = computedFn((node)=>{
1199
+ var _node_props;
1200
+ if (!node) throw new Error('Invalid node');
1201
+ if (this.isRootNode(node)) return NODE_ROOT_LABEL;
1202
+ // A reusable-component instance stands for one specific definition, and
1203
+ // its component label is the same generic word for every one of them —
1204
+ // a page built from promoted sections reads as a column of identical
1205
+ // "Reusable Component" rows in the hierarchy and identical badges on the
1206
+ // canvas. The definition's name rides on the instance for exactly this
1207
+ // (`props.name`, AGL-1193), so prefer it. An explicit per-node `name`
1208
+ // still wins, since that is someone deliberately renaming this instance.
1209
+ const instanceName = node.componentId === REUSABLE_INSTANCE_COMPONENT_ID ? (_node_props = node.props) == null ? void 0 : _node_props.name : undefined;
1210
+ const componentLabel = node.componentId && this.aglyn.components.getLabel(node.componentId);
1211
+ return (node == null ? void 0 : node.name) || (_isStrT(instanceName) ? instanceName : undefined) || componentLabel || (node == null ? void 0 : node.$id);
1212
+ });
1213
+ /**
1214
+ * Whether a node can host inserted child nodes. The document root and
1215
+ * layout containers (Stack, Section, Container — anything with a real
1216
+ * children slot) can; a leaf whose component is self-closing or renders
1217
+ * its `children` as inline text (a screen link, button, icon, image) has
1218
+ * no slot to receive them and can't. Components with no registered schema
1219
+ * default to accepting children.
1220
+ *
1221
+ * `flags.dropping: DISABLED` is the third way to say "no canvas child
1222
+ * slot" (AGL-1388), for components that are neither self-closing nor text
1223
+ * leaves but still have nowhere to put a dropped node:
1224
+ *
1225
+ * - Markdown renders the parsed `content` prop and nothing else, so a
1226
+ * dropped element lands somewhere the markdown source cannot say.
1227
+ * - A Reusable Component instance is opaque: compose REPLACES its child
1228
+ * list with the grafted definition subtree, so a canvas-dropped child is
1229
+ * destroyed before the page is rendered.
1230
+ * - A Layout Slot's children come from screen composition.
1231
+ *
1232
+ * The flag was declared on all three, and until now nothing read it —
1233
+ * which is exactly how three /press screenshots came to be parented under
1234
+ * a Markdown node, shipped in the page payload, and never drawn. A
1235
+ * container that accepts children in the hierarchy and discards them at
1236
+ * render is silent data loss: the author sees the nodes in the tree and
1237
+ * the published page does not have them.
1238
+ *
1239
+ * The rule itself lives in {@link schemaAcceptsChildren} (AGL-1389) so the
1240
+ * registry audit that enforces it cannot be checking a *copy* of it — a
1241
+ * second implementation would drift, and would then certify the editor's
1242
+ * behaviour against a rule the editor no longer follows.
1243
+ */ this.nodeAcceptsChildren = computedFn((node)=>{
1244
+ var _this_aglyn_components, _this_aglyn;
1245
+ if (!node) return false;
1246
+ if (this.isRootNode(node)) return true;
1247
+ return schemaAcceptsChildren((_this_aglyn = this.aglyn) == null ? void 0 : (_this_aglyn_components = _this_aglyn.components) == null ? void 0 : _this_aglyn_components.getSchema(node.componentId));
1248
+ });
1249
+ this.makeNested = computedFn((node)=>{
1250
+ // Serialize to a plain schema object: a toJS copy would carry the node's
1251
+ // own toJSON arrow (bound to the live instance), which JSON.stringify
1252
+ // would then prefer over the nested structure built here.
1253
+ const newNode = node instanceof AglynNode ? node.toJSON() : _extends({}, toJS(node));
1254
+ const childNodes = [];
1255
+ for (const childId of toJS(node.nodes) || []){
1256
+ const child = this.getNode(childId);
1257
+ if (child) {
1258
+ const nested = this.makeNested(child);
1259
+ childNodes.push(nested);
1260
+ }
1261
+ }
1262
+ newNode.nodes = childNodes;
1263
+ return newNode;
1264
+ });
1265
+ makeObservable(this, {
1266
+ _initial: observable.ref,
1267
+ _initialConfirmed: observable,
1268
+ // Observable so {@link hasRemoteEdits} is a computed a React observer
1269
+ // re-renders on: the draft prompt has to stop offering Restore the
1270
+ // moment a peer's first change lands, not on the next unrelated
1271
+ // render (AGL-2486).
1272
+ _epoch: observable,
1273
+ nodes: computed,
1274
+ isInitialSame: computed,
1275
+ didSetInitial: computed,
1276
+ hasRemoteEdits: computed,
1277
+ markRemoteNode: action,
1278
+ undo: action,
1279
+ redo: action,
1280
+ saveHistory: action,
1281
+ // An action so the snapshot and the mutation land in ONE mobx
1282
+ // transaction — otherwise `saveHistory` alone notifies observers, and
1283
+ // the canvas renders a frame between the two (AGL-1204).
1284
+ transact: action,
1285
+ // Same reason: several guarded mutators composed into one change are
1286
+ // one render, not one per mutator.
1287
+ batch: action,
1288
+ clearHistory: action,
1289
+ clearNodes: action,
1290
+ reset: action,
1291
+ updateInitialNodes: action,
1292
+ confirmInitialNodes: action,
1293
+ setNode: action,
1294
+ setNodes: action,
1295
+ applyNodes: action,
1296
+ deleteNode: action,
1297
+ reparentNode: action,
1298
+ reorderNode: action,
1299
+ updateNodeFields: action,
1300
+ updateNodeProps: action
1301
+ });
1302
+ this._history = new HistoryManager();
1303
+ }
1304
+ }
1305
+ /**
1306
+ * How long a coalesced burst stays open. Comfortably above typing cadence
1307
+ * and slider tick rate, well below the pause that means "a new adjustment".
1308
+ */ CanvasManager.COALESCE_WINDOW_MS = 500;
1309
+ export default CanvasManager;
1310
+
1311
+ //# sourceMappingURL=canvas-manager.js.map