@metamorph-labs/polymorph 1.0.18 → 1.0.19

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 (319) hide show
  1. package/CHANGELOG.md +242 -0
  2. package/dist/design/systems/desktop.json +1 -1
  3. package/dist/design/systems/dew.json +1 -1
  4. package/dist/design/systems/flint.json +1 -1
  5. package/dist/design/systems/glassmorphic.json +1 -1
  6. package/dist/design/systems/harbor.json +1 -1
  7. package/dist/design/systems/journal.json +1 -1
  8. package/dist/design/systems/pastel.json +1 -1
  9. package/dist/design/systems/pebble.json +1 -1
  10. package/dist/design/systems/plain.json +1 -1
  11. package/dist/design/systems/pop.json +1 -1
  12. package/dist/design/systems/press.json +1 -1
  13. package/dist/packages/angular-ui/src/ai/ArtifactPane.ts +15 -4
  14. package/dist/packages/angular-ui/src/ai/PromptInput.ts +3 -1
  15. package/dist/packages/angular-ui/src/archetypes/Dashboard.ts +38 -20
  16. package/dist/packages/angular-ui/src/archetypes/dashboard.states.ts +52 -0
  17. package/dist/packages/angular-ui/src/controls/ColorInput.ts +62 -34
  18. package/dist/packages/angular-ui/src/controls/Combobox.ts +28 -7
  19. package/dist/packages/angular-ui/src/controls/DatePicker.ts +12 -11
  20. package/dist/packages/angular-ui/src/controls/DateRangePicker.ts +22 -17
  21. package/dist/packages/angular-ui/src/controls/DateRangePickerRangeCalendar.ts +3 -2
  22. package/dist/packages/angular-ui/src/controls/FileUpload.ts +18 -12
  23. package/dist/packages/angular-ui/src/controls/FileUploadRow.ts +24 -4
  24. package/dist/packages/angular-ui/src/controls/MultiSelect.ts +49 -12
  25. package/dist/packages/angular-ui/src/controls/NumberInput.ts +27 -3
  26. package/dist/packages/angular-ui/src/controls/PhoneInput.ts +9 -5
  27. package/dist/packages/angular-ui/src/controls/Select.ts +36 -7
  28. package/dist/packages/angular-ui/src/controls/TagInput.ts +61 -7
  29. package/dist/packages/angular-ui/src/controls/TimeInput.ts +15 -1
  30. package/dist/packages/angular-ui/src/controls/select.states.ts +79 -58
  31. package/dist/packages/angular-ui/src/overlays/Command.ts +50 -13
  32. package/dist/packages/angular-ui/src/overlays/CommandPanel.ts +11 -7
  33. package/dist/packages/angular-ui/src/overlays/ToastViewport.ts +1 -1
  34. package/dist/packages/angular-ui/src/structure/CodeBlock.ts +18 -4
  35. package/dist/packages/angular-ui/src/structure/Stat.ts +295 -84
  36. package/dist/packages/angular-ui/src/structure/stat.states.ts +116 -0
  37. package/dist/packages/cli/src/agents.js +4 -3
  38. package/dist/packages/cli/src/apply.js +43 -18
  39. package/dist/packages/cli/src/check.js +4 -0
  40. package/dist/packages/cli/src/cli.js +6 -2
  41. package/dist/packages/cli/src/elements.js +12 -2
  42. package/dist/packages/cli/src/emit.js +43 -8
  43. package/dist/packages/cli/src/readings.js +29 -3
  44. package/dist/packages/cli/src/skills/bridge.js +1197 -0
  45. package/dist/packages/cli/src/skills/facts.js +190 -0
  46. package/dist/packages/cli/src/skills/native.js +1580 -0
  47. package/dist/packages/cli/src/skills/rules.js +199 -0
  48. package/dist/packages/cli/src/skills/runtime.js +1020 -0
  49. package/dist/packages/cli/src/skills/screen-charts.js +334 -0
  50. package/dist/packages/cli/src/skills/screen-chat.js +247 -0
  51. package/dist/packages/cli/src/skills/screen-code.js +565 -0
  52. package/dist/packages/cli/src/skills/screen-rich-text.js +305 -0
  53. package/dist/packages/cli/src/skills/screen.js +378 -0
  54. package/dist/packages/cli/src/skills/setup-packages.js +307 -0
  55. package/dist/packages/cli/src/skills/setup.js +125 -0
  56. package/dist/packages/cli/src/skills/theme-documents.js +351 -0
  57. package/dist/packages/cli/src/skills/theme.js +208 -0
  58. package/dist/packages/cli/src/skills.js +13 -794
  59. package/dist/packages/cli/src/theme.js +42 -1
  60. package/dist/packages/cli/src/tool-verbs.js +19 -4
  61. package/dist/packages/cli/src/verbs.js +28 -2
  62. package/dist/packages/elements-ui/dist/cdn/chunks/{AppShellUserCard-0eCCnnN_.js → AppShellUserCard-XT4br4fr.js} +1 -1
  63. package/dist/packages/elements-ui/dist/cdn/chunks/{AreaChart-DftfzLG0.js → AreaChart-CXNFfbJ8.js} +1 -1
  64. package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-Pr9_K2uM.js +1 -0
  65. package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcdMgxgY.js → Avatar-3WXoBPLv.js} +1 -1
  66. package/dist/packages/elements-ui/dist/cdn/chunks/{Avatar-DcuvZwe7.js → Avatar-BKqjM8qW.js} +1 -1
  67. package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarButton-D5XKVduu.js → AvatarButton-BasMQCSM.js} +1 -1
  68. package/dist/packages/elements-ui/dist/cdn/chunks/{AvatarGroup-DgFwJUNO.js → AvatarGroup-COch2-O0.js} +1 -1
  69. package/dist/packages/elements-ui/dist/cdn/chunks/{BarChart-myuR0aHc.js → BarChart-ugae8zfr.js} +1 -1
  70. package/dist/packages/elements-ui/dist/cdn/chunks/{ChatMessage-CgQ1h_JP.js → ChatMessage-Bx4yrF2x.js} +1 -1
  71. package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-B_e5ma3K.js +1 -0
  72. package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-Fgtr48Vb.js +1 -0
  73. package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-CD7rsWRp.js +1 -0
  74. package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-CUw7z6TS.js +1 -0
  75. package/dist/packages/elements-ui/dist/cdn/chunks/{Combobox-DB2FT7so.js → Combobox-hWIFU9X_.js} +1 -1
  76. package/dist/packages/elements-ui/dist/cdn/chunks/Command-BXgqRd3I.js +1 -0
  77. package/dist/packages/elements-ui/dist/cdn/chunks/{ConfirmDialog-BtQOAHY2.js → ConfirmDialog-CAaBRKxl.js} +1 -1
  78. package/dist/packages/elements-ui/dist/cdn/chunks/{Dashboard-ChMPH4_Q.js → Dashboard-DwNw5Wnd.js} +1 -1
  79. package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-DjqtswQR.js +1 -0
  80. package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-LsXFHOzm.js +1 -0
  81. package/dist/packages/elements-ui/dist/cdn/chunks/{DonutChart-BEK89BeL.js → DonutChart-DYXx6eTe.js} +1 -1
  82. package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-3gbZTSSx.js +1 -0
  83. package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-PlLLDKqc.js → FormField-Bvw4cLBc.js} +1 -1
  84. package/dist/packages/elements-ui/dist/cdn/chunks/{FormField-C6L3vYp4.js → FormField-DzhcinED.js} +1 -1
  85. package/dist/packages/elements-ui/dist/cdn/chunks/{FunnelChart-DVQz_gad.js → FunnelChart-D24XhrGw.js} +1 -1
  86. package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-fAcu6Vrw.js → Heading-Cvfyu8pc.js} +1 -1
  87. package/dist/packages/elements-ui/dist/cdn/chunks/{Heading-CgzEi9OQ.js → Heading-XDJzlwt9.js} +1 -1
  88. package/dist/packages/elements-ui/dist/cdn/chunks/{Heatmap-BRwR-n-V.js → Heatmap-BQoUS6gY.js} +1 -1
  89. package/dist/packages/elements-ui/dist/cdn/chunks/{Hero-CV2YWeb4.js → Hero-CXuuFceS.js} +1 -1
  90. package/dist/packages/elements-ui/dist/cdn/chunks/{Histogram-CCYwlinB.js → Histogram-DW_ZPHpR.js} +1 -1
  91. package/dist/packages/elements-ui/dist/cdn/chunks/{LineChart-BH6Pq1P1.js → LineChart-kf-zlNWe.js} +1 -1
  92. package/dist/packages/elements-ui/dist/cdn/chunks/{Markdown-DmZEch4i.js → Markdown-C3rjhIbt.js} +1 -1
  93. package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-DQ86CK9h.js +1 -0
  94. package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-DbSx9QtV.js +1 -0
  95. package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-B4ZZOGLl.js +7 -0
  96. package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-BsMfbNi6.js +210 -0
  97. package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-l_-zAXSZ.js +1 -0
  98. package/dist/packages/elements-ui/dist/cdn/chunks/{RadarChart-Coje7Sb0.js → RadarChart-CwJAWRki.js} +1 -1
  99. package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextContent-CufjptHF.js → RichTextContent-D51UfuWk.js} +1 -1
  100. package/dist/packages/elements-ui/dist/cdn/chunks/{RichTextInput-Dz7yBFUA.js → RichTextInput-B32fN_p9.js} +3 -3
  101. package/dist/packages/elements-ui/dist/cdn/chunks/{ScatterChart-Do5tQTC5.js → ScatterChart-Mps7l5-i.js} +1 -1
  102. package/dist/packages/elements-ui/dist/cdn/chunks/Select-CpsRP0NR.js +1 -0
  103. package/dist/packages/elements-ui/dist/cdn/chunks/Stat-CXR6bP7X.js +1 -0
  104. package/dist/packages/elements-ui/dist/cdn/chunks/Stat-DGcx2ZZq.js +1 -0
  105. package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-BhkLU4gE.js +1 -0
  106. package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-r2jNTOLN.js +1 -0
  107. package/dist/packages/elements-ui/dist/cdn/chunks/{Toast-CAYGbn7g.js → Toast-BTfcZn0I.js} +1 -1
  108. package/dist/packages/elements-ui/dist/cdn/chunks/{ToastViewport-CFslglYc.js → ToastViewport-BBQMRCQT.js} +1 -1
  109. package/dist/packages/elements-ui/dist/cdn/chunks/{ToolCall-DUCoKsoE.js → ToolCall-DNU5kk9_.js} +1 -1
  110. package/dist/packages/elements-ui/dist/cdn/chunks/{Treemap-Bh3ruYGJ.js → Treemap-BV8TlZHB.js} +1 -1
  111. package/dist/packages/elements-ui/dist/cdn/chunks/agent-DfOqpL9c.js +1 -0
  112. package/dist/packages/elements-ui/dist/cdn/chunks/api-DJBiUXxK.js +4 -0
  113. package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-D4YdFevY.js +1 -0
  114. package/dist/packages/elements-ui/dist/cdn/chunks/cap-DA71oFHt.js +1 -0
  115. package/dist/packages/elements-ui/dist/cdn/chunks/{cartesian-I5uPfyqv.js → cartesian-CEn2lJCc.js} +1 -1
  116. package/dist/packages/elements-ui/dist/cdn/chunks/{chart-annotations.module-xUExw4pu.js → chart-annotations.module-hA_KO_Pe.js} +1 -1
  117. package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-C_8txUW5.js +1 -0
  118. package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-BpfyTQ9R.js +1 -0
  119. package/dist/packages/elements-ui/dist/cdn/chunks/check-CHvc4yHL.js +1 -0
  120. package/dist/packages/elements-ui/dist/cdn/chunks/css-vars-DeZ4TCna.js +1 -0
  121. package/dist/packages/elements-ui/dist/cdn/chunks/draw-BiQ3Of6N.js +1 -0
  122. package/dist/packages/elements-ui/dist/cdn/chunks/drawing-nhJNBahV.js +1 -0
  123. package/dist/packages/elements-ui/dist/cdn/chunks/field-labels-Df5HuYC5.js +1 -0
  124. package/dist/packages/elements-ui/dist/cdn/chunks/frame-CtTY4oCn.js +1 -0
  125. package/dist/packages/elements-ui/dist/cdn/chunks/on-call-YKLF3-FH.js +1 -0
  126. package/dist/packages/elements-ui/dist/cdn/chunks/runtime-QRQ3CjZg.js +1 -0
  127. package/dist/packages/elements-ui/dist/cdn/chunks/series-uUg6_JtL.js +1 -0
  128. package/dist/packages/elements-ui/dist/cdn/chunks/src-XnWjGSDr.js +67 -0
  129. package/dist/packages/elements-ui/dist/cdn/chunks/toast-pwGvxH2T.js +1 -0
  130. package/dist/packages/elements-ui/dist/cdn/chunks/urls-Qks0KJ_p.js +6 -0
  131. package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-Dro53ATH.js +1 -0
  132. package/dist/packages/elements-ui/dist/cdn/polymorph-all.js +52 -50
  133. package/dist/packages/elements-ui/dist/cdn/polymorph.css +1 -1
  134. package/dist/packages/elements-ui/dist/cdn/polymorph.js +1 -1
  135. package/dist/packages/elements-ui/dist/cdn/prepaint.js +1 -1
  136. package/dist/packages/elements-ui/dist/cdn/themes/desktop.css +5 -4
  137. package/dist/packages/elements-ui/dist/cdn/themes/dew.css +5 -4
  138. package/dist/packages/elements-ui/dist/cdn/themes/flint.css +5 -4
  139. package/dist/packages/elements-ui/dist/cdn/themes/glassmorphic.css +5 -4
  140. package/dist/packages/elements-ui/dist/cdn/themes/harbor.css +5 -4
  141. package/dist/packages/elements-ui/dist/cdn/themes/journal.css +5 -4
  142. package/dist/packages/elements-ui/dist/cdn/themes/pastel.css +5 -4
  143. package/dist/packages/elements-ui/dist/cdn/themes/pebble.css +5 -4
  144. package/dist/packages/elements-ui/dist/cdn/themes/plain.css +5 -4
  145. package/dist/packages/elements-ui/dist/cdn/themes/pop.css +5 -4
  146. package/dist/packages/elements-ui/dist/cdn/themes/press.css +5 -4
  147. package/dist/packages/elements-ui/dist/cdn/themes/terminal.css +5 -4
  148. package/dist/packages/elements-ui/src/ai/ArtifactPane.ts +2 -0
  149. package/dist/packages/elements-ui/src/archetypes/dashboard.states.ts +9 -0
  150. package/dist/packages/elements-ui/src/controls/ColorInput.ts +2 -0
  151. package/dist/packages/elements-ui/src/controls/NumberInput.ts +2 -0
  152. package/dist/packages/elements-ui/src/controls/TagInput.ts +4 -0
  153. package/dist/packages/elements-ui/src/controls/TimeInput.ts +2 -0
  154. package/dist/packages/elements-ui/src/controls/select.states.ts +10 -0
  155. package/dist/packages/elements-ui/src/overlays/Command.ts +2 -0
  156. package/dist/packages/elements-ui/src/structure/CodeBlock.ts +5 -2
  157. package/dist/packages/elements-ui/src/structure/Stat.ts +6 -0
  158. package/dist/packages/elements-ui/src/structure/stat.states.ts +33 -0
  159. package/dist/packages/mcp/src/propose.js +92 -15
  160. package/dist/packages/mcp/src/server.js +19 -8
  161. package/dist/packages/mcp/src/tools.js +80 -5
  162. package/dist/packages/mcp/src/write.js +95 -13
  163. package/dist/packages/react-ui/src/ai/ArtifactPane.tsx +5 -2
  164. package/dist/packages/react-ui/src/ai/PromptInput.tsx +5 -2
  165. package/dist/packages/react-ui/src/archetypes/dashboard.states.tsx +28 -0
  166. package/dist/packages/react-ui/src/controls/ColorInput.tsx +69 -13
  167. package/dist/packages/react-ui/src/controls/Combobox.tsx +13 -5
  168. package/dist/packages/react-ui/src/controls/DatePicker.tsx +3 -0
  169. package/dist/packages/react-ui/src/controls/DateRangePicker.tsx +22 -5
  170. package/dist/packages/react-ui/src/controls/FileUpload.tsx +2 -0
  171. package/dist/packages/react-ui/src/controls/MultiSelect.tsx +30 -6
  172. package/dist/packages/react-ui/src/controls/NumberInput.tsx +19 -1
  173. package/dist/packages/react-ui/src/controls/PhoneInput.tsx +3 -3
  174. package/dist/packages/react-ui/src/controls/Select.tsx +59 -23
  175. package/dist/packages/react-ui/src/controls/TagInput.tsx +43 -10
  176. package/dist/packages/react-ui/src/controls/TimeInput.tsx +10 -0
  177. package/dist/packages/react-ui/src/controls/date-segments.tsx +16 -0
  178. package/dist/packages/react-ui/src/controls/select.states.tsx +13 -0
  179. package/dist/packages/react-ui/src/overlays/Command.tsx +23 -2
  180. package/dist/packages/react-ui/src/overlays/Toaster.tsx +2 -2
  181. package/dist/packages/react-ui/src/structure/CodeBlock.tsx +7 -3
  182. package/dist/packages/react-ui/src/structure/Stat.tsx +90 -13
  183. package/dist/packages/react-ui/src/structure/stat.states.tsx +68 -0
  184. package/dist/packages/recipes/src/ai/artifact-pane.module.css +4 -4
  185. package/dist/packages/recipes/src/controls/rich-text-input.module.css +1 -1
  186. package/dist/packages/recipes/src/structure/avatar.module.css +3 -1
  187. package/dist/packages/recipes/src/structure/heading.module.css +5 -4
  188. package/dist/packages/recipes/src/structure/hero.module.css +3 -1
  189. package/dist/packages/recipes/src/structure/stat.module.css +7 -0
  190. package/dist/packages/registry/src/card.js +4 -3
  191. package/dist/packages/registry/src/frameworks.js +28 -1
  192. package/dist/packages/registry/src/runtime-card.js +300 -0
  193. package/dist/packages/registry/src/runtime-members.js +176 -0
  194. package/dist/packages/registry/src/screen-table.js +166 -0
  195. package/dist/packages/rules/package.js +1 -1
  196. package/dist/packages/solid-ui/src/ai/ArtifactPane.tsx +11 -3
  197. package/dist/packages/solid-ui/src/ai/PromptInput.tsx +3 -1
  198. package/dist/packages/solid-ui/src/archetypes/Dashboard.tsx +3 -0
  199. package/dist/packages/solid-ui/src/archetypes/dashboard.states.tsx +39 -0
  200. package/dist/packages/solid-ui/src/controls/ColorInput.tsx +38 -17
  201. package/dist/packages/solid-ui/src/controls/Combobox.tsx +27 -6
  202. package/dist/packages/solid-ui/src/controls/DatePicker.tsx +12 -11
  203. package/dist/packages/solid-ui/src/controls/DateRangePicker.tsx +21 -16
  204. package/dist/packages/solid-ui/src/controls/DateRangePickerRangeCalendar.tsx +3 -4
  205. package/dist/packages/solid-ui/src/controls/FileUpload.tsx +1 -0
  206. package/dist/packages/solid-ui/src/controls/FileUploadRow.tsx +6 -0
  207. package/dist/packages/solid-ui/src/controls/MultiSelect.tsx +51 -11
  208. package/dist/packages/solid-ui/src/controls/NumberInput.tsx +21 -2
  209. package/dist/packages/solid-ui/src/controls/PhoneInput.tsx +8 -4
  210. package/dist/packages/solid-ui/src/controls/Select.tsx +37 -6
  211. package/dist/packages/solid-ui/src/controls/TagInput.tsx +26 -5
  212. package/dist/packages/solid-ui/src/controls/TimeInput.tsx +10 -1
  213. package/dist/packages/solid-ui/src/controls/select.states.tsx +18 -0
  214. package/dist/packages/solid-ui/src/overlays/Command.tsx +15 -2
  215. package/dist/packages/solid-ui/src/overlays/CommandPanel.tsx +7 -7
  216. package/dist/packages/solid-ui/src/overlays/ToastViewport.tsx +1 -1
  217. package/dist/packages/solid-ui/src/structure/CodeBlock.tsx +9 -5
  218. package/dist/packages/solid-ui/src/structure/Stat.tsx +86 -25
  219. package/dist/packages/solid-ui/src/structure/stat.states.tsx +73 -0
  220. package/dist/packages/svelte-ui/src/ai/ArtifactPane.svelte +8 -2
  221. package/dist/packages/svelte-ui/src/ai/PromptInput.svelte +3 -1
  222. package/dist/packages/svelte-ui/src/archetypes/Dashboard.svelte +3 -0
  223. package/dist/packages/svelte-ui/src/archetypes/dashboard.states.svelte +2 -0
  224. package/dist/packages/svelte-ui/src/controls/ColorInput.svelte +29 -8
  225. package/dist/packages/svelte-ui/src/controls/Combobox.svelte +26 -5
  226. package/dist/packages/svelte-ui/src/controls/DatePicker.svelte +7 -5
  227. package/dist/packages/svelte-ui/src/controls/DateRangePicker.svelte +15 -9
  228. package/dist/packages/svelte-ui/src/controls/DateRangePickerRangeCalendar.svelte +3 -2
  229. package/dist/packages/svelte-ui/src/controls/FileUpload.svelte +1 -0
  230. package/dist/packages/svelte-ui/src/controls/FileUploadRow.svelte +8 -1
  231. package/dist/packages/svelte-ui/src/controls/MultiSelect.svelte +36 -10
  232. package/dist/packages/svelte-ui/src/controls/NumberInput.svelte +14 -1
  233. package/dist/packages/svelte-ui/src/controls/PhoneInput.svelte +3 -3
  234. package/dist/packages/svelte-ui/src/controls/Select.svelte +20 -6
  235. package/dist/packages/svelte-ui/src/controls/TagInput.svelte +21 -3
  236. package/dist/packages/svelte-ui/src/controls/TimeInput.svelte +11 -1
  237. package/dist/packages/svelte-ui/src/controls/select.states.svelte +26 -24
  238. package/dist/packages/svelte-ui/src/overlays/Command.svelte +13 -1
  239. package/dist/packages/svelte-ui/src/overlays/CommandPanel.svelte +11 -6
  240. package/dist/packages/svelte-ui/src/overlays/ToastViewport.svelte +1 -1
  241. package/dist/packages/svelte-ui/src/structure/CodeBlock.svelte +7 -2
  242. package/dist/packages/svelte-ui/src/structure/Stat.svelte +70 -17
  243. package/dist/packages/svelte-ui/src/structure/stat.states.svelte +27 -0
  244. package/dist/packages/theme/src/admit.js +6 -3
  245. package/dist/packages/theme/src/color/resolve.js +19 -2
  246. package/dist/packages/theme/src/derive.js +13 -6
  247. package/dist/packages/theme/src/emit.js +1 -1
  248. package/dist/packages/theme/src/runtime.js +58 -0
  249. package/dist/packages/theme/src/seeds.js +30 -4
  250. package/dist/packages/theme/src/systems.js +1 -1
  251. package/dist/packages/theme/src/tokens.js +15 -6
  252. package/dist/packages/vue-ui/src/ai/ArtifactPane.vue +11 -2
  253. package/dist/packages/vue-ui/src/ai/PromptInput.vue +3 -1
  254. package/dist/packages/vue-ui/src/archetypes/Dashboard.vue +3 -0
  255. package/dist/packages/vue-ui/src/archetypes/dashboard.states.ts +49 -0
  256. package/dist/packages/vue-ui/src/controls/ColorInput.vue +33 -12
  257. package/dist/packages/vue-ui/src/controls/Combobox.vue +26 -5
  258. package/dist/packages/vue-ui/src/controls/DatePicker.vue +12 -11
  259. package/dist/packages/vue-ui/src/controls/DateRangePicker.vue +20 -15
  260. package/dist/packages/vue-ui/src/controls/DateRangePickerRangeCalendar.vue +3 -4
  261. package/dist/packages/vue-ui/src/controls/FileUpload.vue +1 -0
  262. package/dist/packages/vue-ui/src/controls/FileUploadRow.vue +6 -0
  263. package/dist/packages/vue-ui/src/controls/MultiSelect.vue +37 -10
  264. package/dist/packages/vue-ui/src/controls/NumberInput.vue +17 -1
  265. package/dist/packages/vue-ui/src/controls/PhoneInput.vue +7 -3
  266. package/dist/packages/vue-ui/src/controls/Select.vue +22 -7
  267. package/dist/packages/vue-ui/src/controls/TagInput.vue +21 -3
  268. package/dist/packages/vue-ui/src/controls/TimeInput.vue +10 -1
  269. package/dist/packages/vue-ui/src/controls/select.states.ts +17 -0
  270. package/dist/packages/vue-ui/src/overlays/Command.vue +13 -1
  271. package/dist/packages/vue-ui/src/overlays/CommandPanel.vue +7 -7
  272. package/dist/packages/vue-ui/src/overlays/ToastViewport.vue +1 -1
  273. package/dist/packages/vue-ui/src/structure/CodeBlock.vue +7 -2
  274. package/dist/packages/vue-ui/src/structure/Stat.vue +71 -18
  275. package/dist/packages/vue-ui/src/structure/stat.states.ts +67 -0
  276. package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Contracts.kt +144 -33
  277. package/dist/platforms/android/ui/src/generated/kotlin/dev/polymorph/ui/Members.kt +17 -7
  278. package/dist/platforms/ios/Sources/PolymorphUI/Generated/Contracts.swift +204 -31
  279. package/dist/registry/registry.json +371 -75
  280. package/dist/screen/assets/{screen-CuQbskb8.css → screen-B22PTPwF.css} +1 -1
  281. package/dist/screen/assets/screen-Cpbh7XMb.js +372 -0
  282. package/dist/screen/screen.html +3 -3
  283. package/package.json +1 -1
  284. package/dist/packages/elements-ui/dist/cdn/chunks/ArtifactPane-DsmRlr6d.js +0 -1
  285. package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-BqP8HZKM.js +0 -1
  286. package/dist/packages/elements-ui/dist/cdn/chunks/CodeBlock-D8VARz0a.js +0 -1
  287. package/dist/packages/elements-ui/dist/cdn/chunks/ColorInput-BrzZOVeL.js +0 -1
  288. package/dist/packages/elements-ui/dist/cdn/chunks/Combobox-BiUq0h-w.js +0 -1
  289. package/dist/packages/elements-ui/dist/cdn/chunks/Command-hmxVRdFg.js +0 -1
  290. package/dist/packages/elements-ui/dist/cdn/chunks/DatePicker-C8prGbJ2.js +0 -1
  291. package/dist/packages/elements-ui/dist/cdn/chunks/DateRangePicker-CO1ioqwN.js +0 -1
  292. package/dist/packages/elements-ui/dist/cdn/chunks/FileUpload-HPQe-ttb.js +0 -1
  293. package/dist/packages/elements-ui/dist/cdn/chunks/ModeSwitch-CerqbGv3.js +0 -1
  294. package/dist/packages/elements-ui/dist/cdn/chunks/MultiSelect-CQq7jPgI.js +0 -1
  295. package/dist/packages/elements-ui/dist/cdn/chunks/NumberInput-Dre9GwBy.js +0 -7
  296. package/dist/packages/elements-ui/dist/cdn/chunks/PhoneInput-D6_J6Es_.js +0 -210
  297. package/dist/packages/elements-ui/dist/cdn/chunks/PromptInput-BXcsUQ5W.js +0 -1
  298. package/dist/packages/elements-ui/dist/cdn/chunks/Select-DxGQgv2q.js +0 -1
  299. package/dist/packages/elements-ui/dist/cdn/chunks/Stat-FsMUWigK.js +0 -1
  300. package/dist/packages/elements-ui/dist/cdn/chunks/Stat-WS8v6BQv.js +0 -1
  301. package/dist/packages/elements-ui/dist/cdn/chunks/TagInput-D-uIQEGS.js +0 -1
  302. package/dist/packages/elements-ui/dist/cdn/chunks/TimeInput-Dho571vA.js +0 -1
  303. package/dist/packages/elements-ui/dist/cdn/chunks/agent-DBDk4wLH.js +0 -1
  304. package/dist/packages/elements-ui/dist/cdn/chunks/api-B9sGZiYn.js +0 -4
  305. package/dist/packages/elements-ui/dist/cdn/chunks/avatar.module-CQwnWhWo.js +0 -1
  306. package/dist/packages/elements-ui/dist/cdn/chunks/cap-Ct4k7zNC.js +0 -1
  307. package/dist/packages/elements-ui/dist/cdn/chunks/chart-brush.module-DycBfben.js +0 -1
  308. package/dist/packages/elements-ui/dist/cdn/chunks/chart-twin.module-Cks7VwS5.js +0 -1
  309. package/dist/packages/elements-ui/dist/cdn/chunks/check-dOfCSYFA.js +0 -1
  310. package/dist/packages/elements-ui/dist/cdn/chunks/draw-DclRgiWM.js +0 -1
  311. package/dist/packages/elements-ui/dist/cdn/chunks/drawing-DjkZr0z8.js +0 -1
  312. package/dist/packages/elements-ui/dist/cdn/chunks/frame-BSvl4y47.js +0 -1
  313. package/dist/packages/elements-ui/dist/cdn/chunks/on-call-Jk1sYJc_.js +0 -1
  314. package/dist/packages/elements-ui/dist/cdn/chunks/receivers-BpRfF6dV.js +0 -4
  315. package/dist/packages/elements-ui/dist/cdn/chunks/series-C_1TNd2n.js +0 -1
  316. package/dist/packages/elements-ui/dist/cdn/chunks/src-Bub3C9YP.js +0 -67
  317. package/dist/packages/elements-ui/dist/cdn/chunks/toast-AarMGYJn.js +0 -1
  318. package/dist/packages/elements-ui/dist/cdn/chunks/webmcp-eEPzSqph.js +0 -1
  319. package/dist/screen/assets/screen-Clj2u6_s.js +0 -372
@@ -1,210 +0,0 @@
1
- import{a as e,l as t,o as n}from"./Icon-BjPIXI8I.js";import{A as r,B as i,C as a,F as o,I as s,J as c,L as l,N as u,P as d,Q as f,V as p,W as m,Y as h,et as g,n as _,nt as v,rt as y,v as b}from"./element-CqIhTGKu.js";import{r as x}from"./agent-Dt8YlN7n.js";import{t as S}from"./composition-ChkgUGQ-.js";import{n as C,t as w}from"./effects-BBm2yMRe.js";import"./src-C2HZtjku.js";import{t as T}from"./Input-YafcZQc5.js";import{t as E}from"./Combobox-BiUq0h-w.js";var D=`1 US CA AG AI AS BB BM BS DM DO GD GU JM KN KY LC MP MS PR SX TC TT VC VG VI
2
- 7 RU KZ
3
- 20 EG
4
- 211 SS
5
- 212 MA EH
6
- 213 DZ
7
- 216 TN
8
- 218 LY
9
- 220 GM
10
- 221 SN
11
- 222 MR
12
- 223 ML
13
- 224 GN
14
- 225 CI
15
- 226 BF
16
- 227 NE
17
- 228 TG
18
- 229 BJ
19
- 230 MU
20
- 231 LR
21
- 232 SL
22
- 233 GH
23
- 234 NG
24
- 235 TD
25
- 236 CF
26
- 237 CM
27
- 238 CV
28
- 239 ST
29
- 240 GQ
30
- 241 GA
31
- 242 CG
32
- 243 CD
33
- 244 AO
34
- 245 GW
35
- 246 IO
36
- 247 AC
37
- 248 SC
38
- 249 SD
39
- 250 RW
40
- 251 ET
41
- 252 SO
42
- 253 DJ
43
- 254 KE
44
- 255 TZ
45
- 256 UG
46
- 257 BI
47
- 258 MZ
48
- 260 ZM
49
- 261 MG
50
- 262 RE YT
51
- 263 ZW
52
- 264 NA
53
- 265 MW
54
- 266 LS
55
- 267 BW
56
- 268 SZ
57
- 269 KM
58
- 27 ZA
59
- 290 SH TA
60
- 291 ER
61
- 297 AW
62
- 298 FO
63
- 299 GL
64
- 30 GR
65
- 31 NL
66
- 32 BE
67
- 33 FR
68
- 34 ES
69
- 350 GI
70
- 351 PT
71
- 352 LU
72
- 353 IE
73
- 354 IS
74
- 355 AL
75
- 356 MT
76
- 357 CY
77
- 358 FI AX
78
- 359 BG
79
- 36 HU
80
- 370 LT
81
- 371 LV
82
- 372 EE
83
- 373 MD
84
- 374 AM
85
- 375 BY
86
- 376 AD
87
- 377 MC
88
- 378 SM
89
- 380 UA
90
- 381 RS
91
- 382 ME
92
- 383 XK
93
- 385 HR
94
- 386 SI
95
- 387 BA
96
- 389 MK
97
- 39 IT VA
98
- 40 RO
99
- 41 CH
100
- 420 CZ
101
- 421 SK
102
- 423 LI
103
- 43 AT
104
- 44 GB GG IM JE
105
- 45 DK
106
- 46 SE
107
- 47 NO SJ
108
- 48 PL
109
- 49 DE
110
- 500 FK
111
- 501 BZ
112
- 502 GT
113
- 503 SV
114
- 504 HN
115
- 505 NI
116
- 506 CR
117
- 507 PA
118
- 508 PM
119
- 509 HT
120
- 51 PE
121
- 52 MX
122
- 53 CU
123
- 54 AR
124
- 55 BR
125
- 56 CL
126
- 57 CO
127
- 58 VE
128
- 590 GP BL MF
129
- 591 BO
130
- 592 GY
131
- 593 EC
132
- 594 GF
133
- 595 PY
134
- 596 MQ
135
- 597 SR
136
- 598 UY
137
- 599 CW BQ
138
- 60 MY
139
- 61 AU CC CX
140
- 62 ID
141
- 63 PH
142
- 64 NZ
143
- 65 SG
144
- 66 TH
145
- 670 TL
146
- 672 NF
147
- 673 BN
148
- 674 NR
149
- 675 PG
150
- 676 TO
151
- 677 SB
152
- 678 VU
153
- 679 FJ
154
- 680 PW
155
- 681 WF
156
- 682 CK
157
- 683 NU
158
- 685 WS
159
- 686 KI
160
- 687 NC
161
- 688 TV
162
- 689 PF
163
- 690 TK
164
- 691 FM
165
- 692 MH
166
- 81 JP
167
- 82 KR
168
- 84 VN
169
- 850 KP
170
- 852 HK
171
- 853 MO
172
- 855 KH
173
- 856 LA
174
- 86 CN
175
- 880 BD
176
- 886 TW
177
- 90 TR
178
- 91 IN
179
- 92 PK
180
- 93 AF
181
- 94 LK
182
- 95 MM
183
- 960 MV
184
- 961 LB
185
- 962 JO
186
- 963 SY
187
- 964 IQ
188
- 965 KW
189
- 966 SA
190
- 967 YE
191
- 968 OM
192
- 970 PS
193
- 971 AE
194
- 972 IL
195
- 973 BH
196
- 974 QA
197
- 975 BT
198
- 976 MN
199
- 977 NP
200
- 98 IR
201
- 992 TJ
202
- 993 TM
203
- 994 AZ
204
- 995 GE
205
- 996 KG
206
- 998 UZ`,O=`AE AF AL AM AR AT AU AX AZ BA BD BE BG BL BO BR CC CH CN CU CX DE DZ EC EG EH
207
- ET FI FR GB GE GF GG GH GP HR ID IE IL IM IN IQ IR JE JO JP KE KG KH KR LA LB LK LY MA MD ME
208
- MF MG MK MM MQ MW MY NA NG NL NP NZ PE PH PK PS PY RE RO RS RW SA SD SE SI SK SS SY TH TR TW
209
- TZ UA UG UY VE VN XK YE YT ZA ZM ZW`,k=null;function A(){if(k!==null)return k;let e=new Map,t=new Map,n=[];for(let r of D.split(`
210
- `)){let[i,...a]=r.split(` `);if(i!==void 0){t.set(i,a);for(let t of a)e.set(t,i),n.push(t)}}return k={code:e,regions:t,all:n,trunkZero:new Set(O.split(/\s+/))},k}function j(e){return A().code.get(e.toUpperCase())}function M(e){let{code:t,all:n}=A();if(e===void 0)return[...n];let r=[];for(let n of e){let e=n.toUpperCase();t.has(e)&&!r.includes(e)&&r.push(e)}return r}function N(e,t){return M([...e===void 0?[]:[e],...t??[]])[0]??A().all[0]??`US`}function P(e){return/^\+[1-9]\d{1,14}$/.test(e)}var F=e=>e.replace(/\D/g,``);function I(e){return 15-(j(e)?.length??0)}function L(e,t){let n=F(t);return(n.startsWith(`0`)&&A().trunkZero.has(e.toUpperCase())?n.slice(1):n).slice(0,I(e))}function R(e,t){let n=e.trimStart(),r=F(n);if(n.startsWith(`+`))return`+${r.slice(0,15)}`;let i=r.startsWith(`0`)&&A().trunkZero.has(t.toUpperCase());return r.slice(0,I(t)+ +!!i)}function z(e,t){let n=j(e),r=L(e,t);return n===void 0||r===``?``:`+${n}${r}`}function B(e,t={}){let n=e.trim();if(!n.startsWith(`+`))return null;let r=F(n),{regions:i}=A();for(let e=1;e<=3;e+=1){let n=r.slice(0,e),a=i.get(n);if(a===void 0)continue;let o=t.country?.toUpperCase(),s=M(t.countries??[]).find(e=>a.includes(e)),c=o!==void 0&&a.includes(o)?o:s??a[0]??``;return{country:c,national:L(c,r.slice(e))}}return null}function V(e,t){return e===``?{country:t.country,national:``}:B(e,t)??{country:t.country,national:R(e,t.country)}}function H(e,t,n={}){if(t.trimStart().startsWith(`+`)){let r=B(t,{...n,country:e});return r===null?{country:e,national:R(t,e),value:``}:{...r,value:z(r.country,r.national)}}let r=L(e,t);return{country:e,national:r,value:z(e,r)}}var U=`⁦`,W=`⁩`;function G(e={}){let t=M(e.countries),n=e.include?.toUpperCase();n!==void 0&&j(n)!==void 0&&!t.includes(n)&&t.unshift(n);let r=new Intl.DisplayNames(e.locale,{type:`region`,fallback:`code`}),i=t.map(e=>({value:e,name:r.of(e)??e,label:`${U}+${j(e)??``}${W} ${r.of(e)??e}`}));if(e.countries===void 0){let t=new Intl.Collator(e.locale);i.sort((e,n)=>t.compare(e.name,n.name))}return i.map(({value:e,label:t})=>({value:e,label:t}))}var K={root:`_root_u0txd_7`,country:`_country_u0txd_15`,number:`_number_u0txd_16`},q=i(`<div role=group data-member=phone-input><span></span><span>`),J=i(`<input type=hidden>`);function Y(i){let d=g({size:`md`,disabled:!1,readOnly:!1,invalid:!1},b(i,`group`));return a(()=>{let i=f(),a=t(),g=e(void 0),_=e(d.defaultValue??``),b=e(V(d.value??d.defaultValue??``,{country:N(d.defaultCountry,d.countries),countries:d.countries}).country),D=e(null),O=e(null),k=n(()=>d.locale??g.value??`en-US`),A=n(()=>({country:`Country calling code`,showCountries:`Show countries`,countriesShown:e=>`${e} countries`,noCountry:`No matching country`,...d.messages})),j=n(()=>d.value??_.value),F=n(()=>V(j.value,{country:b.value,countries:d.countries})),I=n(()=>F.value.country),L=n(()=>D.value??F.value.national),z=n(()=>G({locale:k.value,countries:d.countries,include:I.value})),B=n(()=>z.value.find(e=>e.value===I.value)?.label??``),U=n(()=>O.value!==null&&O.value.under===I.value?O.value.text:B.value),W=n(()=>`${i}-country`),Y=n(()=>d[`aria-labelledby`]===void 0?void 0:`${W.value} ${d[`aria-labelledby`]}`),X=n(()=>(e,t)=>{let n=H(e,t,{countries:d.countries});b.value=n.country,D.value=n.value===``&&n.national!==``?n.national:null,n.value!==j.value&&(_.value=n.value,d.onChange?.(n.value))}),Z=n(()=>()=>{D.value!==null&&X.value(I.value,D.value)}),Q=n(()=>e=>{let t=e.target;t instanceof HTMLInputElement&&t.type===`tel`&&w(()=>{t.value!==L.value&&(t.value=L.value)})}),ee=n(()=>e=>{let t=e.target;if(d.readOnly||!(t instanceof HTMLInputElement)||t.type!==`tel`)return;let n=e.clipboardData?.getData(`text/plain`)??``;if(e.preventDefault(),n.trimStart().startsWith(`+`)){let e=H(I.value,n,{countries:d.countries});e.value===``?D.value=e.national:X.value(I.value,n);return}let r=t.selectionStart??L.value.length,i=t.selectionEnd??L.value.length;D.value=R(`${L.value.slice(0,r)}${n}${L.value.slice(i)}`,I.value)});y(()=>{g.value=globalThis.navigator?.language}),C(c(()=>j.value),()=>{r(j.value!==``&&!P(j.value),`PhoneInput: the value "${j.value}" is not an E.164 string. Pass +, the calling code and the national number, or the empty string.`)},!0),C(c(()=>d.countries),()=>{r(d.countries!==void 0&&M(d.countries).length!==d.countries.length,"PhoneInput: `countries` repeats a region or names one with no calling code. Each is listed once, and those are dropped.")},!0);let $;return y(()=>{$?.();let e=x({member:`PhoneInput`,element:()=>a.value,state:()=>({value:j.value,country:I.value,disabled:d.disabled,invalid:d.invalid,readonly:d.readOnly}),actions:{set:{argument:`text`,run:e=>(()=>{if(d.readOnly)throw Error(`The field is read-only.`);if(H(I.value,e,{countries:d.countries}).value===``)throw Error(`"${e}" is not a phone number the field can read.`);X.value(I.value,e)})()},clear:()=>(()=>{if(d.readOnly)throw Error(`The field is read-only.`);X.value(I.value,``)})()},withholds:()=>a.value});$=()=>{e()}}),v(()=>$?.()),(()=>{var e=q(),t=e.firstChild,n=t.nextSibling,r=a.attach;return typeof r==`function`?p(r,e):a.attach=e,o(t,(()=>{var e=s(()=>!!d.readOnly);return()=>e()?m(T,{get value(){return B.value},readOnly:!0,get size(){return d.size},get invalid(){return d.invalid},get disabled(){return d.disabled},get id(){return W.value},get"aria-label"(){return A.value.country},get"aria-labelledby"(){return Y.value},get"aria-describedby"(){return d[`aria-describedby`]}}):m(E,{get options(){return z.value},get value(){return I.value},get inputValue(){return U.value},get size(){return d.size},get invalid(){return d.invalid},get disabled(){return d.disabled},get id(){return W.value},get messages(){return{showOptions:A.value.showCountries,options:A.value.countriesShown}},get emptyMessage(){return A.value.noCountry},get"aria-label"(){return A.value.country},get"aria-labelledby"(){return Y.value},get"aria-describedby"(){return d[`aria-describedby`]},onChange:e=>e!==null&&X.value(e,L.value),onInputChange:e=>O.value={text:e,under:I.value}})})()),n.$$input=e=>Q.value(e),n.addEventListener(`paste`,e=>ee.value(e)),n.$$keydown=e=>e.key===`Enter`&&!S(e)&&Z.value(),o(n,m(T,{type:`tel`,get value(){return L.value},get size(){return d.size},get invalid(){return d.invalid},get disabled(){return d.disabled},get readOnly(){return d.readOnly},get id(){return d.id},autoComplete:`tel-national`,get"aria-label"(){return d[`aria-label`]},get"aria-labelledby"(){return d[`aria-labelledby`]},get"aria-describedby"(){return d[`aria-describedby`]},get"aria-required"(){return d[`aria-required`]},onChange:e=>D.value=R(e,I.value),onBlur:()=>Z.value()})),o(e,(()=>{var e=s(()=>d.name!==void 0);return()=>e()?(()=>{var e=J();return h(t=>{var n=d.name,r=d.disabled||void 0;return n!==t.e&&l(e,`name`,t.e=n),r!==t.t&&(e.disabled=t.t=r),t},{e:void 0,t:void 0}),h(()=>e.value=j.value),e})():null})(),null),h(r=>{var i=K.root,a=d[`aria-label`],o=d[`aria-labelledby`],s=d[`aria-describedby`],c=d.size,f=d.disabled?``:void 0,p=d.invalid?``:void 0,m=d.readOnly?``:void 0,h=K.country,g=K.number;return i!==r.e&&u(e,r.e=i),a!==r.t&&l(e,`aria-label`,r.t=a),o!==r.a&&l(e,`aria-labelledby`,r.a=o),s!==r.o&&l(e,`aria-describedby`,r.o=s),c!==r.i&&l(e,`data-size`,r.i=c),f!==r.n&&l(e,`data-disabled`,r.n=f),p!==r.s&&l(e,`data-invalid`,r.s=p),m!==r.h&&l(e,`data-readonly`,r.h=m),h!==r.r&&u(t,r.r=h),g!==r.d&&u(n,r.d=g),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0}),e})()})}Y.controlKind=`group`,d([`keydown`,`input`]);var X={tag:`poly-phone-input`,member:`PhoneInput`,props:{"aria-describedby":`string`,"aria-label":`string`,"aria-labelledby":`string`,"aria-required":`boolean`,countries:`json`,defaultCountry:`string`,defaultValue:`string`,disabled:`boolean`,id:`string`,invalid:`boolean`,locale:`string`,messages:`json`,name:`string`,readOnly:`boolean`,size:`string`,value:`string`},events:{onChange:{type:`poly-change`}},slots:[],controlled:{value:`onChange`}},Z=_(X,Y);export{Z as PolyPhoneInput,X as definition};
@@ -1 +0,0 @@
1
- import{a as e,l as t,n,o as r}from"./Icon-BjPIXI8I.js";import{B as i,C as a,F as o,I as s,J as c,L as l,N as u,P as d,Q as f,V as p,W as m,Y as h,et as g,n as _,nt as v,rt as y,v as b}from"./element-CqIhTGKu.js";import{n as x,r as S}from"./agent-Dt8YlN7n.js";import{t as C}from"./autosize-Dv2s45QB.js";import{t as ee}from"./composition-ChkgUGQ-.js";import{t as te}from"./field-escape-BwTng_Ci.js";import{t as w}from"./removal-focus-BrZMNHep.js";import{n as T}from"./files-CY1s2M6m.js";import{r as ne,t as E}from"./keyed-DOTZ3iez.js";import{n as D,t as re}from"./effects-BBm2yMRe.js";import"./src-C2HZtjku.js";import{t as O}from"./Button-BJ5X73pv.js";import{t as ie}from"./AttachmentChip-Dmpxxrwb.js";import{t as ae}from"./Skeleton-BSq15Cez.js";var k=/\s/;function oe(e,t,n){if(t===null||n.length===0)return null;for(let r=Math.min(t,e.length)-1;r>=0;--r){let i=e[r];if(k.test(i))return null;let a=n.findIndex(e=>e.char===i);if(a!==-1&&(n[a].at===`start`?r===0:r===0||k.test(e[r-1])))return{trigger:a,start:r,query:e.slice(r+1,t)}}return null}function se(e,t,n,r){let i=e.slice(n);if(r===``)return{text:e.slice(0,t.start)+i,caret:t.start};let a=k.test(i.charAt(0))?``:` `;return{text:e.slice(0,t.start)+r+a+i,caret:t.start+r.length+1}}var A={root:`_root_gz6ul_10`,frame:`_frame_gz6ul_18 _stateFeedback_lkjqs_17`,attachments:`_attachments_gz6ul_51`,field:`_field_gz6ul_43`,toolbar:`_toolbar_gz6ul_111`,end:`_end_gz6ul_120`,picker:`_picker_gz6ul_127`,hint:`_hint_gz6ul_131`,suggestions:`_suggestions_gz6ul_156`,listbox:`_listbox_gz6ul_189`,option:`_option_gz6ul_202 _stateFeedback_lkjqs_17`,glyph:`_glyph_gz6ul_223 _stateFeedback_lkjqs_17`,text:`_text_gz6ul_231`,label:`_label_gz6ul_238`,description:`_description_gz6ul_245 _stateFeedback_lkjqs_17`,rows:`_rows_gz6ul_268`,row:`_row_gz6ul_268`,empty:`_empty_gz6ul_282`,status:`_status_gz6ul_297`},ce=i(`<div data-member=prompt-input><div><textarea rows=1></textarea><div><div>`),le=i(`<div>`),ue=i(`<input type=file tabindex=-1>`),de=i(`<p>`),fe=i(`<div data-prompt-part=suggestions><ul role=listbox>`),pe=i(`<li role=option><span><span>`),me=i(`<span>`),he=i(`<div aria-hidden=true>`),ge=i(`<div role=status aria-live=polite>`);function j(i){let d=g({streaming:!1,disabled:!1,maxRows:8,attachments:[],triggers:[],multiple:!0,autoFocus:!1,messages:{send:`Send`,stop:`Stop`,attach:`Attach`,remove:e=>`Remove ${e}`,uploading:e=>`${e}: uploading`}},b(i));return a(()=>{let i=f(),a=t(),g=t(),_=t(),b=t(),k=t(),j=t(),M=e(d.defaultValue??``),N=e(!1),P=e(null),F=e(!1),I=e(null),L=e({key:``,index:0}),_e=e(`top`),R=e(null),z=e(null),B=r(()=>d.value??M.value),V=r(()=>B.value.trim()===``&&d.attachments.length===0),H=r(()=>d.onAttach!==void 0&&!d.disabled),ve=r(()=>e=>(M.value=e,d.onChange?.(e))),ye=r(()=>()=>!d.disabled&&!d.streaming&&!V.value&&(d.onSubmit?.(B.value),d.value===void 0&&(M.value=``))),be=r(()=>e=>H.value&&e!=null&&e.length>0&&(e=>(e.accepted.length>0&&d.onAttach?.(e.accepted),e.rejected.length>0&&d.onReject?.(e.rejected)))(T(Array.from(e),{accept:d.accept,multiple:d.multiple,maxSize:d.maxSize}))),xe=r(()=>d.triggers.length>0),U=r(()=>d.disabled?null:oe(B.value,P.value,d.triggers)),W=r(()=>U.value===null?void 0:d.triggers[U.value.trigger]),G=r(()=>U.value!==null&&W.value!==void 0&&U.value.start!==I.value),Se=r(()=>U.value?.query??``),Ce=r(()=>new Intl.Collator(void 0,{usage:`search`,sensitivity:`base`})),K=r(()=>Se.value.normalize(`NFC`)),we=r(()=>e=>(e=>K.value===``||(W.value?.filter===`startsWith`?Ce.value.compare(e.slice(0,K.value.length),K.value)===0:Array.from({length:Math.max(0,e.length-K.value.length+1)},(t,n)=>e.slice(n,n+K.value.length)).some(e=>Ce.value.compare(e,K.value)===0)))(e.normalize(`NFC`))),q=r(()=>!G.value||W.value===void 0?[]:W.value.filter===!1?W.value.options:W.value.options.filter(e=>we.value(e.label))),J=r(()=>G.value&&W.value?.loading===!0),Y=r(()=>G.value&&U.value!==null?`${U.value.trigger}:${U.value.start}:${Se.value}`:``),Te=r(()=>G.value&&U.value!==null?`${U.value.trigger}:${U.value.start}`:null),X=r(()=>q.value.length===0?-1:L.value.key===Y.value?Math.min(L.value.index,q.value.length-1):0),Ee=r(()=>`${i}-suggestions`),Z=r(()=>({suggestions:d.messages.suggestions??(e=>`${e} suggestions`),loadingSuggestions:d.messages.loadingSuggestions??`Loading suggestions…`,noSuggestions:d.messages.noSuggestions??`No results`})),De=r(()=>G.value?J.value?Z.value.loadingSuggestions:q.value.length===0?Z.value.noSuggestions:Z.value.suggestions(q.value.length):``),Q=r(()=>(e,t)=>{if(F.value||e.value!==t)return;let n=e.ownerDocument.activeElement===e&&e.selectionStart===e.selectionEnd?e.selectionStart:null,r=d.disabled?null:oe(t,n,d.triggers),i=r!==null&&r.start===I.value?I.value:null;P.value=n,I.value=i;let a=r===null||i!==null?null:r.trigger+`:`+r.start+`:`+r.query;a!==R.value&&(R.value=a,r!==null&&a!==null&&d.triggers[r.trigger]?.onQueryChange?.(r.query))}),Oe=r(()=>e=>{let t=q.value[e],n=U.value,r=W.value;if(t===void 0||n===null||r===void 0||P.value===null)return;let i=se(B.value,n,P.value,t.insert??r.char+t.label);ve.value(i.text),P.value=i.caret,I.value=null,R.value=null,re(()=>_.value?.setSelectionRange(i.caret,i.caret)),r.onSelect?.(t)}),ke=r(()=>e=>{let t=U.value;return!G.value||t===null?!1:e.key===`ArrowDown`||e.key===`ArrowUp`?q.value.length===0?!1:(e.preventDefault(),L.value={key:Y.value,index:e.key===`ArrowDown`?Math.min(X.value+1,q.value.length-1):Math.max(X.value-1,0)},!0):e.key===`Enter`?e.shiftKey||X.value===-1&&!J.value?!1:(e.preventDefault(),X.value!==-1&&Oe.value(X.value),!0):e.key===`Tab`?e.shiftKey||X.value===-1?!1:(e.preventDefault(),Oe.value(X.value),!0):e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),I.value=t.start,R.value=null,!0):!1});D(c(()=>B.value),()=>{_.value&&C(_.value)},!0),y(()=>{d.autoFocus&&_.value&&(_.value.focus(),_.value.setSelectionRange(B.value.length,B.value.length),Q.value(_.value,B.value))});let Ae;D(c(()=>G.value),()=>{Ae?.();let e=G.value&&_.value?te(_.value):()=>{};Ae=()=>{e()}},!0),v(()=>Ae?.()),D(c(()=>d.attachments),()=>{z.value=w(z.value,d.attachments.map(e=>e.id),e=>a.value?.children[e]?.querySelector(`button`),_.value)},!1),D(c(()=>Te.value),()=>{Te.value!==null&&k.value&&(e=>_e.value=e.top>=window.innerHeight-e.bottom?`top`:`bottom`)(k.value.getBoundingClientRect())},!0);let $;return y(()=>{$?.();let e=S({member:`PromptInput`,element:()=>_.value,state:()=>({value:B.value,attachments:d.attachments.map(e=>({id:e.id,label:e.name,...d.onRemoveAttachment!==void 0&&!d.disabled?{}:{disabled:!0}})),streaming:d.streaming,disabled:d.disabled}),actions:{fill:{argument:`text`,run:e=>x(_.value,e)},clear:()=>x(_.value,``),submit:()=>(()=>{if(d.streaming)throw Error(`A reply is arriving; stop it before sending a prompt.`);if(V.value)throw Error(`The prompt is empty, and an empty prompt is not sent.`);ye.value()})(),stop:()=>(()=>{if(!d.streaming)throw Error(`No reply is arriving, so there is nothing to stop.`);d.onStop?.()})(),remove:{argument:`id`,run:e=>d.onRemoveAttachment?.(e)}},withholds:()=>[a.value,d.onAttach===void 0?null:j.value?.firstElementChild,g.value?.lastElementChild]});$=()=>{e()}}),v(()=>$?.()),(()=>{var e=ce(),t=e.firstChild,r=t.firstChild,c=r.nextSibling,f=c.firstChild,v=k.attach;typeof v==`function`?p(v,e):k.attach=e,t.addEventListener(`drop`,e=>H.value&&(e.preventDefault(),N.value=!1,be.value(e.dataTransfer?.files))),t.addEventListener(`dragleave`,e=>!e.currentTarget.contains(e.relatedTarget)&&(N.value=!1)),t.addEventListener(`dragover`,e=>H.value&&(e.preventDefault(),N.value=!0)),o(t,(()=>{var e=s(()=>d.attachments.length>0);return()=>e()?(()=>{var e=le(),t=a.attach;return typeof t==`function`?p(t,e):a.attach=e,o(e,m(E,{get of(){return d.attachments},by:e=>e.id,renew:!0,children:e=>s(()=>s(()=>d.onRemoveAttachment!==void 0&&!d.disabled)()?m(ie,{get name(){return e.name},get size(){return e.size},get status(){return e.status},get message(){return e.message},get removeLabel(){return d.messages.remove(e.name)},get uploadingLabel(){return d.messages.uploading(e.name)},onRemove:()=>(z.value={id:e.id,at:d.attachments.indexOf(ne(e))},d.onRemoveAttachment?.(e.id))}):m(ie,{get name(){return e.name},get size(){return e.size},get status(){return e.status},get message(){return e.message},get removeLabel(){return d.messages.remove(e.name)},get uploadingLabel(){return d.messages.uploading(e.name)}}))})),h(()=>u(e,A.attachments)),e})():null})(),r);var y=_.attach;typeof y==`function`?p(y,r):_.attach=r,r.addEventListener(`paste`,e=>H.value&&(e.clipboardData?.files.length??0)>0&&(e.preventDefault(),be.value(e.clipboardData?.files))),r.addEventListener(`compositionend`,e=>(F.value=!1,Q.value(e.currentTarget,B.value))),r.addEventListener(`compositionstart`,()=>F.value=!0),r.addEventListener(`blur`,()=>(P.value=null,R.value=null)),r.addEventListener(`focus`,e=>Q.value(e.currentTarget,B.value)),r.$$pointerup=e=>Q.value(e.currentTarget,B.value),r.$$keyup=e=>Q.value(e.currentTarget,B.value),r.$$keydown=e=>!ee(e)&&!ke.value(e)&&e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),ye.value()),r.$$input=e=>(ve.value(e.target.value),Q.value(e.target,e.target.value)),o(r,()=>void 0);var x=j.attach;typeof x==`function`?p(x,c):j.attach=c,o(c,(()=>{var e=s(()=>d.onAttach!==void 0);return()=>e()?m(O,{variant:`ghost`,tone:`neutral`,size:`sm`,iconOnly:!0,icon:`attach`,get label(){return d.messages.attach},get disabled(){return d.disabled},onClick:()=>b.value?.click()}):null})(),f),o(c,()=>d.leading,f);var S=g.attach;return typeof S==`function`?p(S,f):g.attach=f,o(f,()=>d.trailing,null),o(f,(()=>{var e=s(()=>!!d.streaming);return()=>e()?m(O,{variant:`outline`,tone:`neutral`,size:`sm`,iconOnly:!0,icon:`stop`,get label(){return d.messages.stop},onClick:()=>d.onStop?.()}):m(O,{variant:`solid`,tone:`accent`,size:`sm`,iconOnly:!0,icon:`send`,get label(){return d.messages.send},get disabled(){return d.disabled||V.value},onClick:()=>ye.value()})})(),null),o(t,(()=>{var e=s(()=>d.onAttach!==void 0);return()=>e()?(()=>{var e=ue(),t=b.attach;return typeof t==`function`?p(t,e):b.attach=e,e.addEventListener(`change`,e=>(be.value(e.target.files),e.target.value=``)),h(t=>{var n=A.picker,r=d.accept,i=d.multiple,a=d.disabled;return n!==t.e&&u(e,t.e=n),r!==t.t&&l(e,`accept`,t.t=r),i!==t.a&&(e.multiple=t.a=i),a!==t.o&&(e.disabled=t.o=a),t},{e:void 0,t:void 0,a:void 0,o:void 0}),e})():null})(),null),o(e,(()=>{var e=s(()=>d.hint!==void 0);return()=>e()?(()=>{var e=de();return o(e,()=>d.hint),h(()=>u(e,A.hint)),e})():null})(),null),o(e,(()=>{var e=s(()=>!!(G.value&&W.value!==void 0));return()=>e()?(()=>{var e=fe(),t=e.firstChild;return e.$$mousedown=e=>e.preventDefault(),o(t,m(E,{get of(){return q.value},by:e=>e.id,renew:!0,children:(e,t)=>(()=>{var r=pe(),a=r.firstChild,c=a.firstChild;return r.$$click=()=>Oe.value(t()),r.$$pointermove=()=>t()!==X.value&&(L.value={key:Y.value,index:t()}),o(r,(()=>{var t=s(()=>e.icon!==void 0);return()=>t()?(()=>{var t=me();return o(t,m(n,{get name(){return e.icon},size:`sm`})),h(()=>u(t,A.glyph)),t})():null})(),a),o(c,()=>e.label),o(a,(()=>{var t=s(()=>e.description!==void 0);return()=>t()?(()=>{var t=me();return o(t,()=>e.description),h(()=>u(t,A.description)),t})():null})(),null),h(e=>{var n=A.option,o=`${i}-suggestion-${t()}`,s=t()===X.value?`true`:`false`,d=t()===X.value?``:void 0,f=A.text,p=A.label;return n!==e.e&&u(r,e.e=n),o!==e.t&&l(r,`id`,e.t=o),s!==e.a&&l(r,`aria-selected`,e.a=s),d!==e.o&&l(r,`data-highlighted`,e.o=d),f!==e.i&&u(a,e.i=f),p!==e.n&&u(c,e.n=p),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),o(e,(()=>{var e=s(()=>!!J.value);return()=>e()?(()=>{var e=he();return o(e,m(E,{of:[0,1,2],by:e=>e,children:()=>(()=>{var e=le();return o(e,m(ae,{textStep:`sm`})),h(()=>u(e,A.row)),e})()})),h(()=>u(e,A.rows)),e})():null})(),null),o(e,(()=>{var e=s(()=>!J.value&&q.value.length===0);return()=>e()?(()=>{var e=he();return o(e,()=>Z.value.noSuggestions),h(()=>u(e,A.empty)),e})():null})(),null),h(n=>{var r=A.suggestions,i=_e.value,a=A.listbox,o=Ee.value,s=W.value?.label;return r!==n.e&&u(e,n.e=r),i!==n.t&&l(e,`data-side`,n.t=i),a!==n.a&&u(t,n.a=a),o!==n.o&&l(t,`id`,n.o=o),s!==n.i&&l(t,`aria-label`,n.i=s),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),e})():null})(),null),o(e,(()=>{var e=s(()=>!!xe.value);return()=>e()?(()=>{var e=ge();return o(e,()=>De.value),h(()=>u(e,A.status)),e})():null})(),null),h(n=>{var a=A.root,o=d.streaming?`streaming`:N.value?`dragover`:void 0,s=d.disabled?``:void 0,p=V.value?``:void 0,m=String(d.maxRows),h=A.frame,g=A.field,_=d.id,v=d.name,y=d.placeholder,b=d.disabled,x=d.label,S=xe.value?`list`:void 0,C=xe.value?`listbox`:void 0,ee=G.value?Ee.value:void 0,te=G.value&&X.value!==-1?`${i}-suggestion-${X.value}`:void 0,w=A.toolbar,T=A.end;return a!==n.e&&u(e,n.e=a),o!==n.t&&l(e,`data-state`,n.t=o),s!==n.a&&l(e,`data-disabled`,n.a=s),p!==n.o&&l(e,`data-empty`,n.o=p),m!==n.i&&l(e,`data-max-rows`,n.i=m),h!==n.n&&u(t,n.n=h),g!==n.s&&u(r,n.s=g),_!==n.h&&l(r,`id`,n.h=_),v!==n.r&&l(r,`name`,n.r=v),y!==n.d&&l(r,`placeholder`,n.d=y),b!==n.l&&(r.disabled=n.l=b),x!==n.u&&l(r,`aria-label`,n.u=x),S!==n.c&&l(r,`aria-autocomplete`,n.c=S),C!==n.w&&l(r,`aria-haspopup`,n.w=C),ee!==n.m&&l(r,`aria-controls`,n.m=ee),te!==n.f&&l(r,`aria-activedescendant`,n.f=te),w!==n.y&&u(c,n.y=w),T!==n.g&&u(f,n.g=T),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0}),h(()=>r.value=B.value),e})()})}d([`input`,`keydown`,`keyup`,`pointerup`,`mousedown`,`pointermove`,`click`]);var M={tag:`poly-prompt-input`,member:`PromptInput`,props:{accept:`string`,attachments:`json`,autoFocus:`boolean`,defaultValue:`string`,disabled:`boolean`,hint:`string`,id:`string`,label:`string`,maxRows:`number`,maxSize:`number`,messages:`property`,multiple:`boolean`,name:`string`,placeholder:`string`,streaming:`boolean`,triggers:`json`,value:`string`},events:{onAttach:{type:`poly-attach`,listened:!0},onChange:{type:`poly-change`},onReject:{type:`poly-reject`},onRemoveAttachment:{type:`poly-remove-attachment`,listened:!0},onStop:{type:`poly-stop`},onSubmit:{type:`poly-submit`}},slots:[`leading`,`trailing`],controlled:{value:`onChange`}},N=_(M,j);export{N as PolyPromptInput,M as definition};
@@ -1 +0,0 @@
1
- import{l as e,n as t,o as n}from"./Icon-BjPIXI8I.js";import{B as r,C as i,F as a,I as o,J as s,L as c,M as l,N as u,O as d,Q as f,V as p,W as m,Y as h,et as g,n as _,nt as ee,rt as te,v,z as y}from"./element-CqIhTGKu.js";import{r as ne}from"./agent-Dt8YlN7n.js";import{n as b,t as x}from"./roving-D6h3urE5.js";import{t as S}from"./media-5ZQ_W_wm.js";import{H as C,Ot as re,P as w,Q as ie,T,W as E,X as D,Y as ae,a as oe,gt as O,l as k,n as se,nt as ce,r as le,t as ue,u as de,vt as A}from"./normalize-props-Dl7PalaD.js";import{n as j}from"./merge-DE9QigF4.js";import{t as M}from"./keyed-DOTZ3iez.js";import{r as N}from"./raf-B8NBjsK_.js";import{t as fe}from"./dismissable-layer-DzSlwKGC.js";import{i as pe,r as me,s as he}from"./form-2kd0Mm1z.js";import{n as ge,t as _e}from"./initial-focus-DGp6LJGX.js";import{t as ve}from"./mutation-observer-DCqc7c7g.js";import{t as ye}from"./scroll-B7yHdY_I.js";import{t as P}from"./typeahead-DWBUVHQX.js";import{t as be}from"./visually-hidden-D7cnxjj8.js";import{n as F}from"./effects-BBm2yMRe.js";import{n as I}from"./presence-qi-0xFxa.js";import"./src-C2HZtjku.js";import{i as xe,r as Se,t as L}from"./dist-uClAa5O5.js";import{n as Ce,r as we,t as Te}from"./get-styles-Bjb5vG_H.js";import{t as R}from"./sheet.module-CskXomSv.js";import{i as Ee,n as z,r as De,t as Oe}from"./selection-map-DlD94rwr.js";var B=se(`select`).parts(`label`,`positioner`,`trigger`,`indicator`,`clearTrigger`,`item`,`itemText`,`itemIndicator`,`itemGroup`,`itemGroupLabel`,`list`,`content`,`root`,`control`,`valueText`).build(),V=e=>new Ee(e);V.empty=()=>new Ee({items:[]});var ke=e=>e.ids?.root??`select:${e.id}`,H=e=>e.ids?.content??`select:${e.id}:content`,U=e=>e.ids?.trigger??`select:${e.id}:trigger`,Ae=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,W=e=>e.ids?.label??`select:${e.id}:label`,je=e=>e.ids?.control??`select:${e.id}:control`,G=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,K=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,Me=e=>e.ids?.positioner??`select:${e.id}:positioner`,Ne=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,Pe=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,Fe=e=>e.getById(K(e)),q=e=>e.getById(H(e)),J=e=>e.getById(U(e)),Ie=e=>e.getById(Ae(e)),Le=e=>e.getById(Me(e)),Re=(e,t)=>t==null?null:e.getById(G(e,t)),ze={clearTriggerLabel:`Clear value`};function Be(e,t){let{context:n,prop:r,scope:i,state:a,computed:o,send:s}=e,c=ce(ze,r(`translations`)),l=r(`disabled`)||n.get(`fieldsetDisabled`),u=!!r(`invalid`),d=!!r(`required`),f=!!r(`readOnly`),p=r(`composite`),m=r(`collection`),h=a.hasTag(`open`),g=a.matches(`focused`),_=n.get(`highlightedValue`),ee=n.get(`highlightedItem`),te=o(`selectedItems`),v=n.get(`currentPlacement`),y=v?we(v):void 0,ne=o(`isTypingAhead`),b=o(`isInteractive`),x=_?G(i,_):void 0;function S(e){let t=m.getItemDisabled(e.item),r=m.getItemValue(e.item);return ie(r,()=>`[zag-js] No value found for item ${JSON.stringify(e.item)}`),{value:r,disabled:!!(l||t),highlighted:_===r,selected:n.get(`value`).includes(r)}}let re=Te({...r(`positioning`),placement:v});return{open:h,focused:g,empty:n.get(`value`).length===0,highlightedItem:ee,highlightedValue:_,selectedItems:te,hasSelectedItems:o(`hasSelectedItems`),value:n.get(`value`),valueAsString:o(`valueAsString`),collection:m,multiple:!!r(`multiple`),disabled:!!l,reposition(e={}){s({type:`POSITIONING.SET`,options:e})},focus(){J(i)?.focus({preventScroll:!0})},setOpen(e){s({type:e?`OPEN`:`CLOSE`,replaces:`open`})},selectValue(e){s({type:`ITEM.SELECT`,value:e})},setValue(e){s({type:`VALUE.SET`,value:e})},selectAll(){s({type:`VALUE.SET`,value:m.getValues()})},setHighlightValue(e){s({type:`HIGHLIGHTED_VALUE.SET`,value:e})},clearHighlightValue(){s({type:`HIGHLIGHTED_VALUE.CLEAR`})},clearValue(e){s(e?{type:`ITEM.CLEAR`,value:e}:{type:`VALUE.CLEAR`})},getItemState:S,getRootProps(){return t.element({...B.root.attrs,dir:r(`dir`),id:ke(i),"data-invalid":E(u),"data-readonly":E(f)})},getLabelProps(){return t.label({dir:r(`dir`),id:W(i),...B.label.attrs,"data-disabled":E(l),"data-invalid":E(u),"data-readonly":E(f),"data-required":E(d),htmlFor:K(i),onClick(e){e.defaultPrevented||l||J(i)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...B.control.attrs,dir:r(`dir`),id:je(i),"data-state":h?`open`:`closed`,"data-focus":E(g),"data-disabled":E(l),"data-invalid":E(u)})},getValueTextProps(){return t.element({...B.valueText.attrs,dir:r(`dir`),"data-disabled":E(l),"data-invalid":E(u),"data-focus":E(g)})},getTriggerProps(){return t.button({id:U(i),disabled:l,dir:r(`dir`),type:`button`,role:`combobox`,"aria-controls":H(i),"aria-expanded":h,"aria-haspopup":`listbox`,"data-state":h?`open`:`closed`,"aria-invalid":u,"aria-required":d,"aria-labelledby":W(i),...B.trigger.attrs,"data-disabled":E(l),"data-invalid":E(u),"data-readonly":E(f),"data-placement":v,"data-side":y,"data-placeholder-shown":E(!o(`hasSelectedItems`)),onClick(e){b&&(e.defaultPrevented||s({type:`TRIGGER.CLICK`}))},onFocus(){s({type:`TRIGGER.FOCUS`})},onBlur(){s({type:`TRIGGER.BLUR`})},onKeyDown(e){if(e.defaultPrevented||!b)return;let t={ArrowUp(){s({type:`TRIGGER.ARROW_UP`})},ArrowDown(e){s({type:e.altKey?`OPEN`:`TRIGGER.ARROW_DOWN`})},ArrowLeft(){s({type:`TRIGGER.ARROW_LEFT`})},ArrowRight(){s({type:`TRIGGER.ARROW_RIGHT`})},Home(){s({type:`TRIGGER.HOME`})},End(){s({type:`TRIGGER.END`})},Enter(){s({type:`TRIGGER.ENTER`})},Space(e){s(ne?{type:`TRIGGER.TYPEAHEAD`,key:e.key}:{type:`TRIGGER.ENTER`})}}[oe(e,{dir:r(`dir`),orientation:`vertical`})];if(t){t(e),e.preventDefault();return}P.isValidEvent(e)&&(s({type:`TRIGGER.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getIndicatorProps(){return t.element({...B.indicator.attrs,dir:r(`dir`),"aria-hidden":!0,"data-state":h?`open`:`closed`,"data-disabled":E(l),"data-invalid":E(u),"data-readonly":E(f)})},getItemProps(e){let n=S(e);return t.element({id:G(i,n.value),role:`option`,...B.item.attrs,dir:r(`dir`),"data-value":n.value,"aria-selected":n.selected,"data-state":n.selected?`checked`:`unchecked`,"data-highlighted":E(n.highlighted),"data-disabled":E(n.disabled),"aria-disabled":C(n.disabled),onPointerMove(e){n.disabled||e.pointerType!==`mouse`||L()===`pointer`&&n.value!==_&&s({type:`ITEM.POINTER_MOVE`,value:n.value})},onClick(e){e.defaultPrevented||n.disabled||s({type:`ITEM.CLICK`,src:`pointerup`,value:n.value})},onPointerLeave(t){n.disabled||e.persistFocus||t.pointerType===`mouse`&&L()===`pointer`&&s({type:`ITEM.POINTER_LEAVE`})}})},getItemTextProps(e){let n=S(e);return t.element({...B.itemText.attrs,"data-state":n.selected?`checked`:`unchecked`,"data-disabled":E(n.disabled),"data-highlighted":E(n.highlighted)})},getItemIndicatorProps(e){let n=S(e);return t.element({"aria-hidden":!0,...B.itemIndicator.attrs,"data-state":n.selected?`checked`:`unchecked`,hidden:!n.selected})},getItemGroupLabelProps(e){let{htmlFor:n}=e;return t.element({...B.itemGroupLabel.attrs,id:Pe(i,n),dir:r(`dir`),role:`presentation`})},getItemGroupProps(e){let{id:n}=e;return t.element({...B.itemGroup.attrs,"data-disabled":E(l),id:Ne(i,n),"aria-labelledby":Pe(i,n),role:`group`,dir:r(`dir`)})},getClearTriggerProps(){return t.button({...B.clearTrigger.attrs,id:Ae(i),type:`button`,"aria-label":c.clearTriggerLabel,"data-invalid":E(u),disabled:l,hidden:!o(`hasSelectedItems`),dir:r(`dir`),onClick(e){e.defaultPrevented||s({type:`CLEAR.CLICK`})}})},getHiddenSelectProps(){let e=n.get(`value`),a=r(`multiple`)?e:e?.[0],o=e=>{me(de(e))||s({type:`VALUE.SET`,value:Ve(e.currentTarget)})};return t.select({name:r(`name`),form:r(`form`),disabled:l,multiple:r(`multiple`),required:r(`required`),"aria-hidden":!0,id:K(i),defaultValue:a,style:be,tabIndex:-1,autoComplete:r(`autoComplete`),onChange:o,onInput:o,onFocus(){J(i)?.focus({preventScroll:!0})},"aria-labelledby":W(i)})},getPositionerProps(){return t.element({...B.positioner.attrs,dir:r(`dir`),id:Me(i),style:re.floating})},getContentProps(){return t.element({hidden:!h,dir:r(`dir`),id:H(i),role:p?`listbox`:`dialog`,...B.content.attrs,"data-state":h?`open`:`closed`,"data-placement":v,"data-side":y,"data-activedescendant":x,"aria-activedescendant":p?x:void 0,"aria-multiselectable":r(`multiple`)&&p?!0:void 0,"aria-labelledby":W(i),tabIndex:0,onKeyDown(e){if(!b||!T(e.currentTarget,k(e)))return;if(e.key===`Tab`&&!ge(e)){e.preventDefault();return}let t={ArrowUp(){s({type:`CONTENT.ARROW_UP`})},ArrowDown(){s({type:`CONTENT.ARROW_DOWN`})},Home(){s({type:`CONTENT.HOME`})},End(){s({type:`CONTENT.END`})},Enter(){s({type:`ITEM.CLICK`,src:`keydown.enter`})},Space(e){ne?s({type:`CONTENT.TYPEAHEAD`,key:e.key}):t.Enter?.(e)}},n=t[oe(e)];if(n){n(e),e.preventDefault();return}w(k(e))||P.isValidEvent(e)&&(s({type:`CONTENT.TYPEAHEAD`,key:e.key}),e.preventDefault())}})},getListProps(){return t.element({...B.list.attrs,tabIndex:0,role:p?void 0:`listbox`,"aria-labelledby":U(i),"aria-activedescendant":p?void 0:x,"aria-multiselectable":!p&&r(`multiple`)?!0:void 0})}}}var Ve=e=>e.multiple?Array.from(e.selectedOptions,e=>e.value):e.value?[e.value]:[],{and:Y,not:X,or:He}=ae(),Ue=D({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??V.empty(),positioning:{placement:`bottom-start`,gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){let r=e(`value`)??e(`defaultValue`)??[],i=e(`collection`).findMany(r);return{value:t(()=>({defaultValue:e(`defaultValue`),value:e(`value`),isEqual:O,onChange(t){let r=n(),i=e(`collection`),a=z({values:t,collection:i,selectedItemMap:r.get(`selectedItemMap`)}),o=e(`value`)??t,s=o===t?a:z({values:o,collection:i,selectedItemMap:a.nextSelectedItemMap});return r.set(`selectedItemMap`,s.nextSelectedItemMap),e(`onValueChange`)?.({value:t,items:a.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e(`defaultHighlightedValue`)||null,value:e(`highlightedValue`),onChange(t){e(`onHighlightChange`)?.({highlightedValue:t,highlightedItem:e(`collection`).find(t),highlightedIndex:e(`collection`).indexOf(t)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:Oe({selectedItems:i,collection:e(`collection`)})}))}},refs(){return{typeahead:{...P.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get(`value`).length>0,isTypingAhead:({refs:e})=>e.get(`typeahead`).keysSoFar!==``,isDisabled:({prop:e,context:t})=>!!e(`disabled`)||!!t.get(`fieldsetDisabled`),isInteractive:({prop:e})=>!(e(`disabled`)||e(`readOnly`)),selectedItems:({context:e,prop:t})=>De({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)}),valueAsString:({computed:e,prop:t})=>t(`collection`).stringifyItems(e(`selectedItems`))},initialState({prop:e}){return e(`open`)||e(`defaultOpen`)?`open`:`idle`},entry:[`syncSelectElement`],watch({context:e,prop:t,track:n,action:r}){n([()=>e.get(`value`).toString()],()=>{r([`syncSelectedItems`,`syncSelectElement`,`dispatchChangeEvent`])}),n([()=>t(`open`)],()=>{r([`toggleVisibility`])}),n([()=>e.get(`highlightedValue`)],()=>{r([`syncHighlightedItem`])}),n([()=>t(`collection`).toString()],()=>{r([`syncCollection`])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:[`setHighlightedItem`]},"HIGHLIGHTED_VALUE.CLEAR":{actions:[`clearHighlightedItem`]},"ITEM.SELECT":{actions:[`selectItem`]},"ITEM.CLEAR":{actions:[`clearItem`]},"VALUE.SET":{actions:[`setSelectedItems`]},"VALUE.CLEAR":{actions:[`clearSelectedItems`]},"CLEAR.CLICK":{actions:[`clearSelectedItems`,`focusTriggerEl`]}},effects:[`trackFormControlState`],states:{idle:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{target:`open`,actions:[`setInitialFocus`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`invokeOnOpen`,`setInitialFocus`,`highlightFirstSelectedItem`]}],"TRIGGER.FOCUS":{target:`focused`},OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}]}},focused:{tags:[`closed`],on:{"CONTROLLED.OPEN":[{guard:`isTriggerClickEvent`,target:`open`,actions:[`setInitialFocus`,`highlightFirstSelectedItem`]},{guard:`isTriggerArrowUpEvent`,target:`open`,actions:[`setInitialFocus`,`highlightComputedLastItem`]},{guard:He(`isTriggerArrowDownEvent`,`isTriggerEnterEvent`),target:`open`,actions:[`setInitialFocus`,`highlightComputedFirstItem`]},{target:`open`,actions:[`setInitialFocus`]}],OPEN:[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`]}],"TRIGGER.BLUR":{target:`idle`},"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightFirstSelectedItem`]}],"TRIGGER.ENTER":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_UP":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedLastItem`]}],"TRIGGER.ARROW_DOWN":[{guard:`isOpenControlled`,actions:[`invokeOnOpen`]},{target:`open`,actions:[`setInitialFocus`,`invokeOnOpen`,`highlightComputedFirstItem`]}],"TRIGGER.ARROW_LEFT":[{guard:Y(X(`multiple`),`hasSelectedItems`),actions:[`selectPreviousItem`]},{guard:X(`multiple`),actions:[`selectLastItem`]}],"TRIGGER.ARROW_RIGHT":[{guard:Y(X(`multiple`),`hasSelectedItems`),actions:[`selectNextItem`]},{guard:X(`multiple`),actions:[`selectFirstItem`]}],"TRIGGER.HOME":{guard:X(`multiple`),actions:[`selectFirstItem`]},"TRIGGER.END":{guard:X(`multiple`),actions:[`selectLastItem`]},"TRIGGER.TYPEAHEAD":{guard:X(`multiple`),actions:[`selectMatchingItem`]}}},open:{tags:[`open`],exit:[`scrollContentToTop`],effects:[`trackDismissableElement`,`trackFocusVisible`,`computePlacement`,`scrollToHighlightedItem`],on:{"CONTROLLED.CLOSE":[{guard:`restoreFocus`,target:`focused`,actions:[`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`clearHighlightedItem`]}],CLOSE:[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{guard:`restoreFocus`,target:`focused`,actions:[`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{target:`idle`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"TRIGGER.CLICK":[{guard:`isOpenControlled`,actions:[`invokeOnClose`]},{target:`focused`,actions:[`invokeOnClose`,`clearHighlightedItem`]}],"ITEM.CLICK":[{guard:Y(`closeOnSelect`,`isOpenControlled`),actions:[`selectHighlightedItem`,`invokeOnClose`]},{guard:`closeOnSelect`,target:`focused`,actions:[`selectHighlightedItem`,`invokeOnClose`,`focusTriggerEl`,`clearHighlightedItem`]},{actions:[`selectHighlightedItem`]}],"CONTENT.HOME":{actions:[`highlightFirstItem`]},"CONTENT.END":{actions:[`highlightLastItem`]},"CONTENT.ARROW_DOWN":[{guard:Y(`hasHighlightedItem`,`loop`,`isLastItemHighlighted`),actions:[`highlightFirstItem`]},{guard:`hasHighlightedItem`,actions:[`highlightNextItem`]},{actions:[`highlightFirstItem`]}],"CONTENT.ARROW_UP":[{guard:Y(`hasHighlightedItem`,`loop`,`isFirstItemHighlighted`),actions:[`highlightLastItem`]},{guard:`hasHighlightedItem`,actions:[`highlightPreviousItem`]},{actions:[`highlightLastItem`]}],"CONTENT.TYPEAHEAD":{actions:[`highlightMatchingItem`]},"ITEM.POINTER_MOVE":{actions:[`highlightItem`]},"ITEM.POINTER_LEAVE":{actions:[`clearHighlightedItem`]},"POSITIONING.SET":{actions:[`reposition`]}}}},implementations:{guards:{loop:({prop:e})=>!!e(`loopFocus`),multiple:({prop:e})=>!!e(`multiple`),hasSelectedItems:({computed:e})=>!!e(`hasSelectedItems`),hasHighlightedItem:({context:e})=>e.get(`highlightedValue`)!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get(`highlightedValue`)===t(`collection`).lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e(`closeOnSelect`)),restoreFocus:({event:e})=>We(e),isOpenControlled:({prop:e})=>e(`open`)!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.CLICK`,isTriggerEnterEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ENTER`,isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_UP`,isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type===`TRIGGER.ARROW_DOWN`},effects:{trackFocusVisible({scope:e}){return xe({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return he(Fe(t),{onFieldsetDisabledChange(t){e.set(`fieldsetDisabled`,t)},onFormReset(){let t=e.initial(`value`);e.set(`value`,t)}})},trackDismissableElement({scope:e,send:t,prop:n}){let r=()=>q(e),i=!0;return fe(r,{type:`listbox`,defer:!0,layerStyleTargets:[()=>Le(e)],exclude:[J(e),Ie(e)],onFocusOutside:n(`onFocusOutside`),onPointerDownOutside:n(`onPointerDownOutside`),onInteractOutside(e){n(`onInteractOutside`)?.(e),i=!(e.detail.focusable||e.detail.contextmenu)},onDismiss(){t({type:`CLOSE`,src:`interact-outside`,restoreFocus:i})}})},computePlacement({context:e,prop:t,scope:n}){let r=t(`positioning`);return e.set(`currentPlacement`,r.placement),Ce(()=>J(n),()=>Le(n),{defer:!0,...r,onComplete(t){e.set(`currentPlacement`,t.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){let r=r=>{let i=e.get(`highlightedValue`);if(i==null||L()===`pointer`)return;let a=q(n),o=t(`scrollToIndexFn`);if(o){let e=t(`collection`).indexOf(i);o?.({index:e,immediate:r,getElement:()=>Re(n,i)});return}ye(Re(n,i),{rootEl:a,block:`nearest`})};return N(()=>{Se(`virtual`),r(!0)}),ve(()=>q(n),{defer:!0,attributes:[`data-activedescendant`],callback(){r(!1)}})}},actions:{reposition({context:e,prop:t,scope:n,event:r}){Ce(J(n),()=>Le(n),{...t(`positioning`),...r.options,defer:!0,listeners:!1,onComplete(t){e.set(`currentPlacement`,t.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t(`open`)?`CONTROLLED.OPEN`:`CONTROLLED.CLOSE`,previousEvent:n})},highlightPreviousItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getPreviousValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightNextItem({context:e,prop:t}){let n=e.get(`highlightedValue`);if(n==null)return;let r=t(`collection`).getNextValue(n,1,t(`loopFocus`));r!=null&&e.set(`highlightedValue`,r)},highlightFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;e.set(`highlightedValue`,n)},highlightLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;e.set(`highlightedValue`,n)},setInitialFocus({scope:e}){N(()=>{let t=_e({root:q(e)});t&&t.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){We(e)&&N(()=>{J(t)?.focus({preventScroll:!0})})},selectHighlightedItem({context:e,prop:t,event:n}){let r=n.value??e.get(`highlightedValue`);r==null||!t(`collection`).has(r)||(t(`onSelect`)?.({value:r}),r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(r)?null:r,e.set(`value`,e=>r==null?[]:t(`multiple`)?A(e,r):[r]))},highlightComputedFirstItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.firstValue;e.set(`highlightedValue`,i)},highlightComputedLastItem({context:e,prop:t,computed:n}){let r=t(`collection`),i=n(`hasSelectedItems`)?r.sort(e.get(`value`))[0]:r.lastValue;e.set(`highlightedValue`,i)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n(`hasSelectedItems`))return;let r=t(`collection`).sort(e.get(`value`))[0];e.set(`highlightedValue`,r)},highlightItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`highlightedValue`)});i!=null&&e.set(`highlightedValue`,i)},setHighlightedItem({context:e,event:t}){e.set(`highlightedValue`,t.value)},clearHighlightedItem({context:e}){e.set(`highlightedValue`,null)},selectItem({context:e,prop:t,event:n}){t(`onSelect`)?.({value:n.value});let r=t(`deselectable`)&&!t(`multiple`)&&e.get(`value`).includes(n.value)?null:n.value;e.set(`value`,e=>r==null?[]:t(`multiple`)?A(e,r):[r])},clearItem({context:e,event:t}){e.set(`value`,e=>e.filter(e=>e!==t.value))},setSelectedItems({context:e,event:t}){e.set(`value`,t.value)},clearSelectedItems({context:e}){e.set(`value`,[])},selectPreviousItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getPreviousValue(n);r&&e.set(`value`,[r])},selectNextItem({context:e,prop:t}){let[n]=e.get(`value`),r=t(`collection`).getNextValue(n);r&&e.set(`value`,[r])},selectFirstItem({context:e,prop:t}){let n=t(`collection`).firstValue;n&&e.set(`value`,[n])},selectLastItem({context:e,prop:t}){let n=t(`collection`).lastValue;n&&e.set(`value`,[n])},selectMatchingItem({context:e,prop:t,event:n,refs:r}){let i=t(`collection`).search(n.key,{state:r.get(`typeahead`),currentValue:e.get(`value`)[0]});i!=null&&e.set(`value`,[i])},scrollContentToTop({prop:e,scope:t}){if(e(`scrollToIndexFn`)){let n=e(`collection`).firstValue;e(`scrollToIndexFn`)?.({index:0,immediate:!0,getElement:()=>Re(t,n)})}else q(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e(`onOpenChange`)?.({open:!0,value:t.get(`value`)})},invokeOnClose({prop:e,context:t}){e(`onOpenChange`)?.({open:!1,value:t.get(`value`)})},syncSelectElement({context:e,prop:t,scope:n}){let r=Fe(n);if(r){if(e.get(`value`).length===0&&!t(`multiple`)){r.selectedIndex=-1;return}for(let t of r.options)t.selected=e.get(`value`).includes(t.value)}},syncCollection({context:e,prop:t}){let n=t(`collection`),r=n.find(e.get(`highlightedValue`));r&&e.set(`highlightedItem`,r);let i=z({values:e.get(`value`),collection:n,selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,i.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){let n=z({values:e.get(`value`),collection:t(`collection`),selectedItemMap:e.get(`selectedItemMap`)});e.set(`selectedItemMap`,n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){let n=t(`collection`),r=e.get(`highlightedValue`),i=r?n.find(r):null;e.set(`highlightedItem`,i)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{let t=Fe(e);if(!t)return;let n=new(e.getWin()).Event(`change`,{bubbles:!0,composed:!0});t.dispatchEvent(pe(n))})}}}});function We(e){let t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}var Z={trigger:`_trigger_1nroi_12 _focusRing_1hr3n_49 _stateFeedback_lkjqs_17`,value:`_value_1nroi_37`,chevron:`_chevron_1nroi_44`,content:`_content_1nroi_119`,viewport:`_viewport_1nroi_139`,sheetList:`_sheetList_1nroi_154`,"select-content-enter":`_select-content-enter_1nroi_1`,"select-content-exit":`_select-content-exit_1nroi_1`,item:`_item_1nroi_194 _stateFeedback_lkjqs_17`,check:`_check_1nroi_218 _stateFeedback_lkjqs_17`,text:`_text_1nroi_227`,description:`_description_1nroi_235 _stateFeedback_lkjqs_17`,group:`_group_1nroi_249`,groupLabel:`_groupLabel_1nroi_258`},Ge=r(`<button><span></span><span aria-hidden=true>`),Ke=r(`<input type=hidden>`),qe=r(`<div><div><div>`),Q=r(`<div><span></span><span><span>`),$=r(`<span>`),Je=r(`<div><div>`),Ye=r(`<div>`),Xe=r(`<div><div data-presentation=sheet tabindex=-1><div>`);function Ze(r){let _=g({size:`md`,invalid:!1,disabled:!1,presentation:`auto`},v(r));return i(()=>{let r=f(),i=e(),v=e(),C=e(),w=e(),ie=S(`phone`),T=n(()=>_.presentation===`auto`&&ie()),E=n(()=>({value:`__polymorph-empty-choice__`,label:_.emptyOption??``,description:void 0,disabled:!1})),D=n(()=>[..._.emptyOption===void 0?[]:[E.value],..._.options.flatMap(e=>`options`in e?e.options:[e])]),ae=re(()=>w.value),oe=le(Ue,()=>({id:r,dir:ae(),collection:V({items:D.value,itemToValue:e=>e.value,itemToString:e=>e.label,isItemDisabled:e=>e.disabled===!0}),value:_.value===void 0?void 0:_.value===null?_.emptyOption===void 0?[]:[`__polymorph-empty-choice__`]:[_.value],defaultValue:_.defaultValue===void 0&&_.emptyOption!==void 0?[`__polymorph-empty-choice__`]:_.defaultValue===void 0?void 0:_.defaultValue===null?_.emptyOption===void 0?[]:[`__polymorph-empty-choice__`]:[_.defaultValue],defaultOpen:_.defaultOpen,disabled:_.disabled,invalid:_.invalid,positioning:{placement:`bottom-start`,gutter:2},ids:_.id===void 0?void 0:{trigger:_.id},onValueChange:e=>{_.onChange?.(e.value[0]===void 0||e.value[0]===`__polymorph-empty-choice__`?null:e.value[0])}})),O=n(()=>Be(oe,ue)),k=n(()=>D.value.find(e=>O.value.value.includes(e.value))),se=n(()=>k.value===void 0),ce=I(()=>O.value.open&&!T.value,()=>i.value),de=I(()=>O.value.open&&T.value,()=>C.value,`sheet.panel`,{sheetSide:`bottom`}),A=I(()=>O.value.open&&T.value,()=>v.value,`dialog.scrim`);F(s(()=>O.value.open),()=>{O.value.open&&O.value.highlightedValue===null&&O.value.setHighlightValue(O.value.value[0]??D.value.find(e=>!e.disabled)?.value??``)},!0),F(s(()=>O.value.open),()=>{O.value.open||b(w.value,i.value)},!1),F(s(()=>O.value.highlightedValue),()=>{x(i.value,O.value.highlightedValue)},!0);let N;return te(()=>{N?.();let e=ne({member:`Select`,element:()=>w.value,state:()=>({value:O.value.value[0]===void 0?_.emptyOption===void 0?null:``:O.value.value[0]===`__polymorph-empty-choice__`?``:O.value.value[0],options:D.value.map(e=>({id:e.value===`__polymorph-empty-choice__`?``:e.value,label:e.label,...e.disabled===!0?{disabled:!0}:{}})),open:O.value.open,disabled:_.disabled}),actions:{choose:{argument:`id`,run:e=>O.value.setValue([e===``?`__polymorph-empty-choice__`:e])},open:()=>O.value.setOpen(!0),close:()=>O.value.setOpen(!1)}});N=()=>{e()}}),ee(()=>N?.()),[(()=>{var e=Ge(),n=e.firstChild,r=n.nextSibling,i=w.attach;return typeof i==`function`?p(i,e):w.attach=e,y(e,g(()=>j(O.value.getTriggerProps(),{class:Z.trigger,"aria-label":_[`aria-label`],"aria-labelledby":_[`aria-labelledby`],"aria-describedby":_[`aria-describedby`],"aria-required":_[`aria-required`],"aria-invalid":_.invalid?!0:void 0,"data-size":_.size,"data-invalid":_.invalid?``:void 0,"data-disabled":_.disabled?``:void 0,"data-placeholder":se.value?``:void 0,"data-member":`select`})),!1,!0),a(n,()=>k.value?.label??(_.emptyOption===void 0?_.placeholder??``:``)),a(r,m(t,{name:`expand`,get size(){return _.size}})),h(e=>{var t=Z.value,i=Z.chevron;return t!==e.e&&u(n,e.e=t),i!==e.t&&u(r,e.t=i),e},{e:void 0,t:void 0}),e})(),o(()=>o(()=>_.name!==void 0)()?(()=>{var e=Ke();return h(t=>{var n=_.name,r=_.disabled||void 0;return n!==t.e&&c(e,`name`,t.e=n),r!==t.t&&(e.disabled=t.t=r),t},{e:void 0,t:void 0}),h(()=>e.value=O.value.value[0]===void 0||O.value.value[0]===`__polymorph-empty-choice__`?``:O.value.value[0]),e})():null),m(l,{get children(){return d(()=>[o(()=>o(()=>!!ce())()?(()=>{var e=qe(),n=e.firstChild,r=n.firstChild;y(e,g(()=>j(O.value.getPositionerProps())),!1,!0);var s=i.attach;return typeof s==`function`?p(s,n):i.attach=n,y(n,g(()=>j(O.value.getContentProps(),{class:Z.content,style:{"--radix-select-trigger-width":`var(--reference-width)`,"--radix-select-content-available-height":`var(--available-height)`,"--radix-select-content-transform-origin":`var(--transform-origin)`},hidden:void 0,"data-size":_.size,"data-member":`select`,onfocus:()=>x(i.value,O.value.highlightedValue)})),!1,!0),a(r,(()=>{var e=o(()=>_.emptyOption!==void 0);return()=>e()?(()=>{var e=Q(),n=e.firstChild,r=n.nextSibling,i=r.firstChild;return y(e,g(()=>j(O.value.getItemProps({item:E.value}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(E.value.value)})),!1,!0),a(n,(()=>{var e=o(()=>!!O.value.value.includes(E.value.value));return()=>e()?m(t,{name:`confirm`,size:`sm`}):null})()),a(i,()=>E.value.label),a(r,(()=>{var e=o(()=>E.value.description!==void 0);return()=>e()?(()=>{var e=$();return a(e,()=>E.value.description),h(()=>u(e,Z.description)),e})():null})(),null),h(e=>{var t=Z.check,i=Z.text;return t!==e.e&&u(n,e.e=t),i!==e.t&&u(r,e.t=i),e},{e:void 0,t:void 0}),e})():null})(),null),a(r,m(M,{get of(){return _.options},by:e=>`options`in e?`group-${e.label}`:e.value,renew:!0,children:e=>o(()=>o(()=>`options`in e)()?(()=>{var n=Je(),r=n.firstChild;return y(n,g(()=>j(O.value.getItemGroupProps({id:e.label}),{class:Z.group})),!1,!0),y(r,g(()=>j(O.value.getItemGroupLabelProps({htmlFor:e.label}),{class:Z.groupLabel})),!1,!0),a(r,()=>e.label),a(n,m(M,{get of(){return e.options},by:e=>e.value,renew:!0,children:e=>(()=>{var n=Q(),r=n.firstChild,i=r.nextSibling,s=i.firstChild;return y(n,g(()=>j(O.value.getItemProps({item:e}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(e.value)})),!1,!0),a(r,(()=>{var n=o(()=>!!O.value.value.includes(e.value));return()=>n()?m(t,{name:`confirm`,size:`sm`}):null})()),a(s,()=>e.label),a(i,(()=>{var t=o(()=>e.description!==void 0);return()=>t()?(()=>{var t=$();return a(t,()=>e.description),h(()=>u(t,Z.description)),t})():null})(),null),h(e=>{var t=Z.check,n=Z.text;return t!==e.e&&u(r,e.e=t),n!==e.t&&u(i,e.t=n),e},{e:void 0,t:void 0}),n})()}),null),n})():(()=>{var n=Q(),r=n.firstChild,i=r.nextSibling,s=i.firstChild;return y(n,g(()=>j(O.value.getItemProps({item:e}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(e.value)})),!1,!0),a(r,(()=>{var n=o(()=>!!O.value.value.includes(e.value));return()=>n()?m(t,{name:`confirm`,size:`sm`}):null})()),a(s,()=>e.label),a(i,(()=>{var t=o(()=>e.description!==void 0);return()=>t()?(()=>{var t=$();return a(t,()=>e.description),h(()=>u(t,Z.description)),t})():null})(),null),h(e=>{var t=Z.check,n=Z.text;return t!==e.e&&u(r,e.e=t),n!==e.t&&u(i,e.t=n),e},{e:void 0,t:void 0}),n})())}),null),h(()=>u(r,Z.viewport)),e})():null),o(()=>o(()=>!!A())()?(()=>{var e=Ye(),t=v.attach;return typeof t==`function`?p(t,e):v.attach=e,h(t=>{var n=R.scrim,r=O.value.open?`open`:`closed`;return n!==t.e&&u(e,t.e=n),r!==t.t&&c(e,`data-state`,t.t=r),t},{e:void 0,t:void 0}),e})():null),o(()=>o(()=>!!de())()?(()=>{var e=Xe(),n=e.firstChild,r=n.firstChild,s=C.attach;typeof s==`function`?p(s,n):C.attach=n;var l=i.attach;return typeof l==`function`?p(l,r):i.attach=r,y(r,g(()=>j(O.value.getContentProps(),{class:Z.sheetList,hidden:void 0,"data-size":_.size,"data-member":`select`,onfocus:()=>x(i.value,O.value.highlightedValue)})),!1,!0),a(r,(()=>{var e=o(()=>_.emptyOption!==void 0);return()=>e()?(()=>{var e=Q(),n=e.firstChild,r=n.nextSibling,i=r.firstChild;return y(e,g(()=>j(O.value.getItemProps({item:E.value}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(E.value.value)})),!1,!0),a(n,(()=>{var e=o(()=>!!O.value.value.includes(E.value.value));return()=>e()?m(t,{name:`confirm`,size:`sm`}):null})()),a(i,()=>E.value.label),a(r,(()=>{var e=o(()=>E.value.description!==void 0);return()=>e()?(()=>{var e=$();return a(e,()=>E.value.description),h(()=>u(e,Z.description)),e})():null})(),null),h(e=>{var t=Z.check,i=Z.text;return t!==e.e&&u(n,e.e=t),i!==e.t&&u(r,e.t=i),e},{e:void 0,t:void 0}),e})():null})(),null),a(r,m(M,{get of(){return _.options},by:e=>`options`in e?`group-${e.label}`:e.value,renew:!0,children:e=>o(()=>o(()=>`options`in e)()?(()=>{var n=Je(),r=n.firstChild;return y(n,g(()=>j(O.value.getItemGroupProps({id:e.label}),{class:Z.group})),!1,!0),y(r,g(()=>j(O.value.getItemGroupLabelProps({htmlFor:e.label}),{class:Z.groupLabel})),!1,!0),a(r,()=>e.label),a(n,m(M,{get of(){return e.options},by:e=>e.value,renew:!0,children:e=>(()=>{var n=Q(),r=n.firstChild,i=r.nextSibling,s=i.firstChild;return y(n,g(()=>j(O.value.getItemProps({item:e}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(e.value)})),!1,!0),a(r,(()=>{var n=o(()=>!!O.value.value.includes(e.value));return()=>n()?m(t,{name:`confirm`,size:`sm`}):null})()),a(s,()=>e.label),a(i,(()=>{var t=o(()=>e.description!==void 0);return()=>t()?(()=>{var t=$();return a(t,()=>e.description),h(()=>u(t,Z.description)),t})():null})(),null),h(e=>{var t=Z.check,n=Z.text;return t!==e.e&&u(r,e.e=t),n!==e.t&&u(i,e.t=n),e},{e:void 0,t:void 0}),n})()}),null),n})():(()=>{var n=Q(),r=n.firstChild,i=r.nextSibling,s=i.firstChild;return y(n,g(()=>j(O.value.getItemProps({item:e}),{class:Z.item,tabindex:`-1`,onfocus:()=>O.value.setHighlightValue(e.value)})),!1,!0),a(r,(()=>{var n=o(()=>!!O.value.value.includes(e.value));return()=>n()?m(t,{name:`confirm`,size:`sm`}):null})()),a(s,()=>e.label),a(i,(()=>{var t=o(()=>e.description!==void 0);return()=>t()?(()=>{var t=$();return a(t,()=>e.description),h(()=>u(t,Z.description)),t})():null})(),null),h(e=>{var t=Z.check,n=Z.text;return t!==e.e&&u(r,e.e=t),n!==e.t&&u(i,e.t=n),e},{e:void 0,t:void 0}),n})())}),null),h(t=>{var r=R.positioner,i=R.panel,a=O.value.open?`open`:`closed`;return r!==t.e&&u(e,t.e=r),i!==t.t&&u(n,t.t=i),a!==t.a&&c(n,`data-state`,t.a=a),t},{e:void 0,t:void 0,a:void 0}),e})():null)])}})]})}var Qe={tag:`poly-select`,member:`Select`,props:{"aria-describedby":`string`,"aria-label":`string`,"aria-labelledby":`string`,"aria-required":`boolean`,defaultOpen:`boolean`,defaultValue:`string`,disabled:`boolean`,emptyOption:`string`,id:`string`,invalid:`boolean`,name:`string`,options:`json`,placeholder:`string`,presentation:`string`,size:`string`,value:`string`},events:{onChange:{type:`poly-change`}},slots:[],controlled:{value:`onChange`}},$e=_(Qe,Ze);export{$e as PolySelect,Qe as definition};
@@ -1 +0,0 @@
1
- import{n as e}from"./element-CqIhTGKu.js";import"./src-C2HZtjku.js";import{t}from"./Stat-WS8v6BQv.js";var n={tag:`poly-stat`,member:`Stat`,props:{delta:`json`,description:`string`,footer:`json`,icon:`string`,label:`string`,numeric:`boolean`,spark:`json`,sparkLabel:`property`,trend:`json`,value:`string`},events:{},slots:[]},r=e(n,t);export{r as PolyStat,n as definition};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./Icon-BjPIXI8I.js";import{B as n,C as r,F as i,I as a,L as o,N as s,W as c,Y as l,et as u,v as d}from"./element-CqIhTGKu.js";import{t as f}from"./Sparkline-DAIv13V_.js";import{t as p}from"./Badge-FiwfyvXx.js";var m={stat:`_stat_1dsvy_6`,labelRow:`_labelRow_1dsvy_12`,label:`_label_1dsvy_12`,labelEnd:`_labelEnd_1dsvy_33`,glyph:`_glyph_1dsvy_40`,valueRow:`_valueRow_1dsvy_49`,spark:`_spark_1dsvy_58`,value:`_value_1dsvy_49`,delta:`_delta_1dsvy_79`,footer:`_footer_1dsvy_106`,footerPrimary:`_footerPrimary_1dsvy_113`,footerGlyph:`_footerGlyph_1dsvy_127`,footerSecondary:`_footerSecondary_1dsvy_133`,description:`_description_1dsvy_142`,spoken:`_spoken_1dsvy_152`},h=n(`<div data-member=stat><div><span></span></div><div><span>`),g=n(`<span>`),_=n(`<span><span aria-hidden=true></span><span>`),v=n(`<div><span></span><span>`);function y(n){let y=u({numeric:!0,sparkLabel:e=>`${e}, recent trend`},d(n));return r(()=>{let n=t(()=>y.delta===void 0?void 0:y.delta.positive??y.delta.direction===`up`);return(()=>{var t=h(),r=t.firstChild,u=r.firstChild,d=r.nextSibling,b=d.firstChild;return i(u,()=>y.label),i(r,(()=>{var t=a(()=>y.icon!==void 0||y.trend!==void 0);return()=>t()?(()=>{var t=g();return i(t,(()=>{var t=a(()=>y.icon!==void 0);return()=>t()?(()=>{var t=g();return i(t,c(e,{get name(){return y.icon}})),l(()=>s(t,m.glyph)),t})():null})(),null),i(t,(()=>{var e=a(()=>y.trend!==void 0);return()=>e()?c(p,{variant:`outline`,get icon(){return y.trend.direction},get children(){return y.trend.label}}):null})(),null),l(()=>s(t,m.labelEnd)),t})():null})(),null),i(b,()=>y.value),i(d,(()=>{var e=a(()=>y.spark!==void 0);return()=>e()?(()=>{var e=g();return i(e,c(f,{get data(){return y.spark},get label(){return y.sparkLabel(y.label)}})),l(()=>s(e,m.spark)),e})():null})(),null),i(t,(()=>{var t=a(()=>y.delta!==void 0);return()=>t()?(()=>{var t=_(),r=t.firstChild,a=r.nextSibling;return i(t,c(e,{get name(){return y.delta.direction},size:`sm`}),r),i(r,()=>y.delta.value),i(a,()=>`${y.delta.direction} ${y.delta.value} — ${n.value?`positive`:`negative`}`),l(e=>{var r=m.delta,i=y.delta.direction,c=n.value?``:void 0,l=m.spoken;return r!==e.e&&s(t,e.e=r),i!==e.t&&o(t,`data-direction`,e.t=i),c!==e.a&&o(t,`data-positive`,e.a=c),l!==e.o&&s(a,e.o=l),e},{e:void 0,t:void 0,a:void 0,o:void 0}),t})():a(()=>y.description!==void 0)()?(()=>{var e=g();return i(e,()=>y.description),l(()=>s(e,m.description)),e})():null})(),null),i(t,(()=>{var t=a(()=>y.footer!==void 0);return()=>t()?(()=>{var t=v(),n=t.firstChild,r=n.nextSibling;return i(n,()=>y.footer.primary,null),i(n,(()=>{var t=a(()=>y.trend!==void 0);return()=>t()?(()=>{var t=g();return i(t,c(e,{get name(){return y.trend.direction},size:`sm`})),l(()=>s(t,m.footerGlyph)),t})():null})(),null),i(r,()=>y.footer.secondary),l(e=>{var i=m.footer,a=m.footerPrimary,o=m.footerSecondary;return i!==e.e&&s(t,e.e=i),a!==e.t&&s(n,e.t=a),o!==e.a&&s(r,e.a=o),e},{e:void 0,t:void 0,a:void 0}),t})():null})(),null),l(e=>{var n=m.stat,i=m.labelRow,a=m.label,c=m.valueRow,l=m.value,f=y.numeric?``:void 0;return n!==e.e&&s(t,e.e=n),i!==e.t&&s(r,e.t=i),a!==e.a&&s(u,e.a=a),c!==e.o&&s(d,e.o=c),l!==e.i&&s(b,e.i=l),f!==e.n&&o(b,`data-numeric`,e.n=f),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),t})()})}export{y as t};
@@ -1 +0,0 @@
1
- import{a as e,l as t,n,o as r}from"./Icon-BjPIXI8I.js";import{B as i,C as a,F as o,G as s,I as c,J as l,L as u,N as d,P as f,Q as p,V as m,W as h,Y as g,Z as _,et as v,n as y,nt as b,rt as x,tt as S,v as C}from"./element-CqIhTGKu.js";import{r as w}from"./agent-Dt8YlN7n.js";import{t as T}from"./composition-ChkgUGQ-.js";import{t as E}from"./field-escape-BwTng_Ci.js";import{t as D}from"./line-keys-Cq0G7zeh.js";import{t as O}from"./keyed-DOTZ3iez.js";import{n as k}from"./effects-BBm2yMRe.js";import{n as A}from"./presence-qi-0xFxa.js";import"./src-C2HZtjku.js";var j={container:`_container_1pxac_11 _focusRing_1hr3n_49 _stateFeedback_lkjqs_17`,chips:`_chips_1pxac_38`,chip:`_chip_1pxac_38`,label:`_label_1pxac_55 _stateFeedback_lkjqs_17`,remove:`_remove_1pxac_73 _focusRing_1hr3n_49 _stateFeedback_lkjqs_17 _pressable_lkjqs_38`,input:`_input_1pxac_113`,reader:`_reader_1pxac_133 _visuallyHidden_qxi8b_14`,"tag-input-duplicate":`_tag-input-duplicate_1pxac_1`,"tag-input-refusal":`_tag-input-refusal_1pxac_1`},M=i(`<li><span>`),N=i(`<button type=button>`);function P(e){let r=C(e);return a(()=>{let e=t(),i=A(()=>r.open,()=>e.value,`taginput.chip`,{get appear(){return r.appear},reflow:`taginput.reflow`});return k(l(()=>i()),()=>{i()||r.onDone?.()},!1),(()=>{var t=M(),i=t.firstChild,a=e.attach;return typeof a==`function`?m(a,t):e.attach=t,o(i,()=>r.tag),o(t,(()=>{var e=c(()=>!r.disabled);return()=>e()?(()=>{var e=N();return e.$$keydown=e=>r.onKeyDown?.(e),e.$$click=()=>r.onRemove?.(),o(e,h(n,{name:`close`,size:`sm`})),g(t=>{var n=j.remove,i=r.removeLabel;return n!==t.e&&d(e,t.e=n),i!==t.t&&u(e,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),e})():null})(),null),g(e=>{var n=j.chip,a=r.open?void 0:``,o=r.flash?``:void 0,s=j.label;return n!==e.e&&d(t,e.e=n),a!==e.t&&u(t,`data-removing`,e.t=a),o!==e.a&&u(t,`data-flash`,e.a=o),s!==e.o&&d(i,e.o=s),e},{e:void 0,t:void 0,a:void 0,o:void 0}),t})()})}f([`click`,`keydown`]);var F=i(`<div data-member=tag-input><ul></ul><input type=text><span></span><span aria-live=polite>`),I=i(`<input type=hidden>`);function L(n){let i=v({validate:e=>e.trim()===``?null:e.trim(),size:`md`,disabled:!1,invalid:!1,removeLabel:e=>`Remove ${e}`},C(n,`field`));return a(()=>{let n=p(),a=t(),f=t(),v=e(i.defaultValue??[]),y=e(``),C=e(null),A=e(!1),M=e(``),N=e(!1),L=r(()=>i.value??v.value),R=r(()=>i.max!==void 0&&L.value.length>=i.max),z=r(()=>`${i.id??n}-count`),B=r(()=>e=>{v.value=e,i.onChange?.(e)}),V=r(()=>e=>{let t=[...L.value],n=!1,r=null;for(let a of e){if(i.max!==void 0&&t.length>=i.max)break;let e=i.validate(a);if(e===null){n=!0;continue}if(t.includes(e)){r=e;continue}t.push(e)}A.value=n,C.value=r,t.length!==L.value.length&&B.value(t)}),H=r(()=>e=>a.value?.querySelectorAll(`:scope > li:not([data-removing]) button`)[e]??null),U=r(()=>e=>{let t=L.value,n=t.indexOf(e),r=n===-1||n+1>=t.length?null:H.value(n+1);B.value(t.filter(t=>t!==e)),M.value=`${e} removed, ${t.length-1} remain`,r?r.focus():f.value?.focus()}),W=r(()=>e=>{y.value=e.target.value}),G=r(()=>y.value!==``),K=r(()=>e=>{if(T(e))return;if(e.key===`Enter`||e.key===`,`){e.preventDefault(),V.value([y.value]),y.value=``;return}if(e.key===`Escape`&&y.value!==``){e.preventDefault(),y.value=``;return}if(e.key===`Backspace`&&y.value===``){let e=L.value[L.value.length-1];e!==void 0&&U.value(e);return}if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let t=e.target;e.key===D(a.value??t)&&t.selectionStart===0&&H.value(L.value.length-1)?.focus()}),q=r(()=>(e,t)=>{let n=L.value.indexOf(t);if(n!==-1){if(e.key===`Backspace`||e.key===`Delete`){e.preventDefault(),U.value(t);return}if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault();let t=e.key===D(a.value??e.target)?-1:1;n+t===L.value.length?f.value?.focus():n+t>=0&&H.value(n+t)?.focus()}}}),ee=r(()=>e=>{let t=e.clipboardData?.getData(`text`)??``;/[\n,]+/.test(t)&&(e.preventDefault(),V.value(t.split(/[\n,]+/)),y.value=``)}),te=r(()=>e=>{e.target.closest(`button, input`)||(e.preventDefault(),f.value?.focus())}),ne=r(()=>e=>{e.currentTarget.contains(e.relatedTarget)||i.onBlur?.(e)}),J=l(()=>L.value),Y=e=>e,[X,Z]=_([]);s(S(J,(e,t)=>{if(t===void 0)return;let n=new Set(e.map(Y)),r=X().filter(e=>!n.has(e.key));t.forEach((e,t)=>{let i=Y(e);!n.has(i)&&!r.some(e=>e.key===i)&&r.push({key:i,item:e,at:t})}),Z(r)}));let re=l(()=>{let e=J().map(e=>({item:e,key:Y(e),open:!0,done:()=>{}}));for(let t of[...X()].sort((e,t)=>e.at-t.at))e.splice(Math.min(t.at,e.length),0,{item:t.item,key:t.key,open:!1,done:()=>Z(e=>e.filter(e=>e.key!==t.key))});return e});x(()=>{N.value=!0});let Q;k(l(()=>G.value),()=>{Q?.();let e=G.value&&f.value?E(f.value):()=>{};Q=()=>{e()}},!0),b(()=>Q?.());let $;return x(()=>{$?.();let e=w({member:`TagInput`,element:()=>f.value,state:()=>({value:L.value,disabled:i.disabled,invalid:i.invalid}),actions:{add:{argument:`text`,run:e=>(()=>{if(/[\n,]/.test(e))throw Error(`A tag holds no comma or line break: add each tag on its own.`);if(R.value)throw Error(`The field holds its maximum of ${i.max} tags.`);let t=i.validate(e);if(t===null)throw Error(`The field refuses "${e}" as a tag.`);if(L.value.includes(t))throw Error(`The field already holds "${t}".`);V.value([e])})()},clear:()=>(L.value.length>0&&B.value([]),void 0)}});$=()=>{e()}}),b(()=>$?.()),(()=>{var e=F(),t=e.firstChild,n=t.nextSibling,r=n.nextSibling,s=r.nextSibling;e.addEventListener(`animationend`,()=>(A.value=!1,C.value=null)),e.$$focusout=e=>ne.value(e),e.$$mousedown=e=>te.value(e);var l=a.attach;typeof l==`function`?m(l,t):a.attach=t,o(t,h(O,{get of(){return re()},by:e=>e.key,renew:!0,children:e=>h(P,{get tag(){return e.item},get open(){return e.open},get appear(){return N.value},get flash(){return C.value===e.item},get disabled(){return i.disabled},get removeLabel(){return i.removeLabel(e.item)},onRemove:()=>U.value(e.item),onKeyDown:t=>q.value(t,e.item),onDone:()=>e.done()})}));var p=f.attach;return typeof p==`function`?m(p,n):f.attach=n,n.addEventListener(`paste`,e=>ee.value(e)),n.$$keydown=e=>K.value(e),n.$$input=e=>W.value(e),o(r,(()=>{var e=c(()=>!!R.value);return()=>e()?`Maximum of ${i.max} added`:`${L.value.length} added`})()),o(s,()=>M.value),o(e,(()=>{var e=c(()=>i.name!==void 0);return()=>e()?(()=>{var e=I();return g(t=>{var n=i.name,r=i.disabled;return n!==t.e&&u(e,`name`,t.e=n),r!==t.t&&(e.disabled=t.t=r),t},{e:void 0,t:void 0}),g(()=>e.value=L.value.join(`,`)),e})():null})(),null),g(a=>{var o=j.container,c=i.size,l=R.value?`at-max`:void 0,f=i.disabled?``:void 0,p=i.invalid?``:void 0,m=A.value?``:void 0,h=j.chips,g=j.input,_=L.value.length===0?i.placeholder:void 0,v=R.value,y=i.disabled,b=i.id,x=i[`aria-label`],S=i[`aria-labelledby`],C=[i[`aria-describedby`],z.value].filter(Boolean).join(` `),w=i[`aria-required`],T=i.invalid?!0:void 0,E=j.reader,D=z.value,O=j.reader;return o!==a.e&&d(e,a.e=o),c!==a.t&&u(e,`data-size`,a.t=c),l!==a.a&&u(e,`data-state`,a.a=l),f!==a.o&&u(e,`data-disabled`,a.o=f),p!==a.i&&u(e,`data-invalid`,a.i=p),m!==a.n&&u(e,`data-refused`,a.n=m),h!==a.s&&d(t,a.s=h),g!==a.h&&d(n,a.h=g),_!==a.r&&u(n,`placeholder`,a.r=_),v!==a.d&&(n.readOnly=a.d=v),y!==a.l&&(n.disabled=a.l=y),b!==a.u&&u(n,`id`,a.u=b),x!==a.c&&u(n,`aria-label`,a.c=x),S!==a.w&&u(n,`aria-labelledby`,a.w=S),C!==a.m&&u(n,`aria-describedby`,a.m=C),w!==a.f&&u(n,`aria-required`,a.f=w),T!==a.y&&u(n,`aria-invalid`,a.y=T),E!==a.g&&d(r,a.g=E),D!==a.p&&u(r,`id`,a.p=D),O!==a.b&&d(s,a.b=O),a},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0,b:void 0}),g(()=>n.value=y.value),e})()})}L.controlKind=`field`,f([`mousedown`,`focusout`,`input`,`keydown`]);var R={tag:`poly-tag-input`,member:`TagInput`,props:{"aria-describedby":`string`,"aria-label":`string`,"aria-labelledby":`string`,"aria-required":`boolean`,defaultValue:`json`,disabled:`boolean`,id:`string`,invalid:`boolean`,max:`number`,name:`string`,placeholder:`string`,removeLabel:`property`,size:`string`,validate:`property`,value:`json`},events:{onBlur:{type:`poly-blur`},onChange:{type:`poly-change`}},slots:[],controlled:{value:`onChange`}},z=y(R,L);export{z as PolyTagInput,R as definition};
@@ -1 +0,0 @@
1
- import{a as e,l as t,o as n}from"./Icon-BjPIXI8I.js";import{B as r,F as i,I as a,J as o,L as s,N as c,P as l,Q as u,V as d,W as f,Y as p,et as m,n as h,nt as g,rt as _,v}from"./element-CqIhTGKu.js";import{r as y}from"./agent-Dt8YlN7n.js";import{_ as b,a as x,d as S,g as C,u as w,v as T,y as E}from"./agent-DtA7MQVd.js";import{r as D,t as O}from"./keyed-DOTZ3iez.js";import{n as k}from"./effects-BBm2yMRe.js";import{t as A}from"./temporal-CLMm4jwS.js";import"./src-C2HZtjku.js";var j={field:`_field_162jx_18 _focusRing_1hr3n_49 _stateFeedback_lkjqs_17`,segments:`_segments_162jx_44`,segment:`_segment_162jx_44`,separator:`_separator_162jx_78`},M=r(`<div role=group data-member=time-input><div>`),N=r(`<span aria-hidden=true>`),P=r(`<div role=spinbutton spellcheck=false>`),F=r(`<input type=hidden>`);function I(r){let l=m({granularity:`minute`,size:`md`,disabled:!1,readOnly:!1,invalid:!1},v(r,`group`)),h=u(),A=t(),I=e(void 0),L=e(b(l.value===void 0?l.defaultValue:l.value,{locale:l.locale??I.value??`en-US`,parts:l.granularity===`hour`?[`hour`]:[`hour`,`minute`],hourCycle:l.hourCycle})),R=e(``),z=e((l.value===void 0?l.defaultValue:l.value)?.toString()??``),B=n(()=>l.locale??I.value??`en-US`),V=n(()=>({locale:B.value,parts:l.granularity===`hour`?[`hour`]:[`hour`,`minute`],hourCycle:l.hourCycle})),H=n(()=>S(L.value,V.value)),U=n(()=>(l.value===void 0?l.defaultValue:l.value)??null),W=n(()=>T(L.value,V.value,U.value)),G=n(()=>e=>{L.value=e;let t=T(e,V.value,U.value),n=t?.toString()??``;n!==z.value&&(z.value=n,l.onChange?.(t))}),K=n(()=>e=>{try{return new Intl.DisplayNames(B.value,{type:`dateTimeField`}).of(e)??e}catch{return e}}),q=n(()=>(e,t)=>{if(!(e instanceof HTMLElement))return;let n=[...e.closest(`[role="group"]`)?.querySelectorAll(`[data-segment]`)??[]];n[n.indexOf(e)+t]?.focus()}),J=n(()=>(e,t)=>{if(t.type===`literal`)return;if(e.key===`ArrowLeft`||e.key===`ArrowRight`){e.preventDefault(),R.value=``,q.value(e.currentTarget,e.key===`ArrowRight`==(getComputedStyle(e.currentTarget).direction!==`rtl`)?1:-1);return}if(e.ctrlKey||e.metaKey||e.key===`Tab`)return;let n=!l.disabled&&!l.readOnly;if(e.key===`ArrowUp`||e.key===`ArrowDown`){e.preventDefault(),R.value=``,n&&G.value(C(L.value,t.type,e.key===`ArrowUp`?1:-1,V.value));return}if(e.key===`Backspace`||e.key===`Delete`){if(e.preventDefault(),R.value=``,!n)return;L.value[t.type]===void 0?q.value(e.currentTarget,-1):G.value(w(L.value,t.type,V.value));return}e.key.length===1&&(e.preventDefault(),n&&(n=>{let r=E(L.value,t.type,R.value,n,V.value);R.value=r.typed,G.value(r.draft),r.advance&&q.value(e.currentTarget,1)})(e.key))}),Y=n(()=>(e,t)=>{if(e.preventDefault(),t.type===`literal`||!(!l.disabled&&!l.readOnly))return;let n=e.data??``;for(let r of n){let n=E(L.value,t.type,R.value,r,V.value);if(R.value=n.typed,G.value(n.draft),n.advance){q.value(e.currentTarget,1);break}}});_(()=>{I.value=globalThis.navigator?.language,l.locale===void 0&&(L.value=b(l.value===void 0?l.defaultValue:l.value,{locale:l.locale??I.value??`en-US`,parts:l.granularity===`hour`?[`hour`]:[`hour`,`minute`],hourCycle:l.hourCycle}))}),k(o(()=>l.value),()=>{l.value!==void 0&&(l.value!==null||W.value!==null)&&(L.value=b(l.value,V.value),z.value=l.value?.toString()??``)},!1);let X;return _(()=>{X?.();let e=y({member:`TimeInput`,element:()=>A.value,state:()=>({value:W.value?.toString()??``,disabled:l.disabled,invalid:l.invalid,readonly:l.readOnly}),actions:{set:{argument:`text`,run:e=>(()=>{if(l.readOnly)throw Error(`The field is read-only.`);G.value(b(x(e,l.granularity),V.value))})()},clear:()=>(()=>{if(l.readOnly)throw Error(`The field is read-only.`);G.value({})})()}});X=()=>{e()}}),g(()=>X?.()),(()=>{var e=M(),t=e.firstChild,n=A.attach;return typeof n==`function`?d(n,e):A.attach=e,i(t,f(O,{get of(){return H.value},by:(e,t)=>`time-${e.type}-${t}`,renew:!0,children:e=>a(()=>a(()=>e.type===`literal`)()?(()=>{var t=N();return i(t,()=>e.text),p(()=>c(t,j.separator)),t})():(()=>{var t=P();return t.$$beforeinput=t=>Y.value(t,D(e)),t.$$keydown=t=>J.value(t,D(e)),t.addEventListener(`focus`,()=>R.value=``),i(t,()=>e.text),p(n=>{var r=j.segment,i=`${h}-time-${e.type}`,a=K.value(e.type),o=l[`aria-labelledby`]?`${l[`aria-labelledby`]} ${h}-time-${e.type}`:void 0,u=l[`aria-describedby`],d=e.placeholder?void 0:e.value,f=e.min,p=e.max,m=e.placeholder?`Empty`:e.text,g=l[`aria-required`]?`true`:void 0,_=l.readOnly?`true`:void 0,v=l.disabled?`true`:void 0,y=l.invalid?`true`:void 0,b=!l.disabled&&!l.readOnly?`true`:void 0,x=e.type===`dayPeriod`?void 0:`numeric`,S=l.disabled?void 0:`0`,C=e.type,w=e.placeholder?``:void 0,T=l.disabled?``:void 0;return r!==n.e&&c(t,n.e=r),i!==n.t&&s(t,`id`,n.t=i),a!==n.a&&s(t,`aria-label`,n.a=a),o!==n.o&&s(t,`aria-labelledby`,n.o=o),u!==n.i&&s(t,`aria-describedby`,n.i=u),d!==n.n&&s(t,`aria-valuenow`,n.n=d),f!==n.s&&s(t,`aria-valuemin`,n.s=f),p!==n.h&&s(t,`aria-valuemax`,n.h=p),m!==n.r&&s(t,`aria-valuetext`,n.r=m),g!==n.d&&s(t,`aria-required`,n.d=g),_!==n.l&&s(t,`aria-readonly`,n.l=_),v!==n.u&&s(t,`aria-disabled`,n.u=v),y!==n.c&&s(t,`aria-invalid`,n.c=y),b!==n.w&&s(t,`contenteditable`,n.w=b),x!==n.m&&s(t,`inputmode`,n.m=x),S!==n.f&&s(t,`tabindex`,n.f=S),C!==n.y&&s(t,`data-segment`,n.y=C),w!==n.g&&s(t,`data-placeholder`,n.g=w),T!==n.p&&s(t,`data-disabled`,n.p=T),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0,y:void 0,g:void 0,p:void 0}),t})())})),i(e,(()=>{var e=a(()=>l.name!==void 0);return()=>e()?(()=>{var e=F();return p(t=>{var n=l.name,r=l.disabled?!0:void 0;return n!==t.e&&s(e,`name`,t.e=n),r!==t.t&&(e.disabled=t.t=r),t},{e:void 0,t:void 0}),p(()=>e.value=W.value?.toString()??``),e})():null})(),null),p(n=>{var r=j.field,i=l.id,a=l[`aria-label`],o=l[`aria-labelledby`],u=l[`aria-describedby`],d=l.disabled?`true`:void 0,f=l.size,p=l.disabled?``:void 0,m=l.invalid?``:void 0,h=l.readOnly?``:void 0,g=j.segments;return r!==n.e&&c(e,n.e=r),i!==n.t&&s(e,`id`,n.t=i),a!==n.a&&s(e,`aria-label`,n.a=a),o!==n.o&&s(e,`aria-labelledby`,n.o=o),u!==n.i&&s(e,`aria-describedby`,n.i=u),d!==n.n&&s(e,`aria-disabled`,n.n=d),f!==n.s&&s(e,`data-size`,n.s=f),p!==n.h&&s(e,`data-disabled`,n.h=p),m!==n.r&&s(e,`data-invalid`,n.r=m),h!==n.d&&s(e,`data-readonly`,n.d=h),g!==n.l&&c(t,n.l=g),n},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),e})()}I.controlKind=`group`,l([`keydown`,`beforeinput`]);var L={tag:`poly-time-input`,member:`TimeInput`,props:{"aria-describedby":`string`,"aria-label":`string`,"aria-labelledby":`string`,"aria-required":`boolean`,defaultValue:{temporal:`time`},disabled:`boolean`,granularity:`string`,hourCycle:`number`,id:`string`,invalid:`boolean`,locale:`string`,name:`string`,readOnly:`boolean`,size:`string`,value:{temporal:`time`}},events:{onChange:{type:`poly-change`}},slots:[],controlled:{value:`onChange`}},R=h(L,I,A);export{R as PolyTimeInput,L as definition};
@@ -1 +0,0 @@
1
- import{a as e,t}from"./agent-Dt8YlN7n.js";import{n,r}from"./webmcp-eEPzSqph.js";var i=e=>e.replace(/\s+/g,` `).trim(),a=new Set([`script`,`style`,`template`,`select`,`textarea`]),o=new Set(`a abbr b bdi bdo cite code data del dfn em i ins kbd mark q s samp small span strong sub sup time u var wbr`.split(` `));function s(e){if(e.nodeType===3)return e.textContent??``;if(e.nodeType!==1)return``;let t=e;if(t.getAttribute(`aria-hidden`)===`true`||t.hasAttribute(`hidden`))return``;let n=t.localName;if(a.has(n))return``;if(n===`img`)return t.getAttribute(`alt`)??``;if(n===`br`)return` `;let r=``;for(let e of t.childNodes){let t=s(e);r+=e.nodeType===1&&!o.has(e.localName)?` ${t} `:t}return r}function c(e){return e?i(s(e)):``}function l(e){let t=e.labels;if(t&&t.length>0)return[...t];let n=[],r=e.parentElement?.closest(`label`);r&&n.push(r);let i=e.id;if(i!==``){let t=e.getRootNode();for(let e of t.querySelectorAll?.(`label[for]`)??[])e.getAttribute(`for`)===i&&!n.includes(e)&&n.push(e)}return n}function u(e,t){let n=e.getAttribute(t),r=e.getRootNode();return n===null||typeof r.getElementById!=`function`?``:i(n.split(/\s+/).map(e=>e===``?null:r.getElementById(e)).map(e=>e?s(e):``).join(` `))}function d(e){return e.localName===`table`?e:e.querySelector(`:scope > table, :scope > [data-member="table"] > table`)}function f(e){if(!e)return``;let t=u(e,`aria-labelledby`);if(t!==``)return t;let n=i(e.getAttribute(`aria-label`)??``);if(n!==``)return n;let r=i(l(e).map(s).join(` `));if(r!==``)return r;let a=i(e.getAttribute(`alt`)??``);if(a!==``)return a;let o=d(e);if(o!==null){let e=o.querySelector(`:scope > caption`);return e===null?``:i(s(e))}let f=c(e);return f===``?i(e.getAttribute(`title`)??``):f}function p(e){return e?u(e,`aria-describedby`):``}var m=`polymorph:agentchange`,h=150,g=16,_={secret:!0},v=`[secret]`,y=e=>typeof e==`object`&&!!e&&!Array.isArray(e),b=e=>Array.isArray(e)&&e.length>0&&e.every(e=>y(e)&&typeof e.id==`string`&&typeof e.label==`string`);function x(e){try{return JSON.stringify(e)??`undefined`}catch{return String(e)}}function S(e){if(e===void 0)return null;try{return JSON.parse(JSON.stringify(e))}catch{return null}}function C(e,t=[]){return typeof e==`string`?t.push(e):typeof e==`number`||typeof e==`bigint`?t.push(String(e)):Array.isArray(e)?e.forEach(e=>C(e,t)):y(e)&&Object.values(e).forEach(e=>C(e,t)),t}var w=(e,t)=>t.length>0&&C(e).some(e=>t.some(t=>e.includes(t)));function T(e,t,n=v){let r=e;for(let e of t)r=r.split(e).join(n);return r}var E=e=>e.toLocaleLowerCase(),D=e=>typeof e==`function`?void 0:e.argument,O=e=>typeof e==`function`||e.argument!==`id`&&e.argument!==`ids`?void 0:e.among,k=e=>Object.values(e).flatMap(e=>b(e)?e:[]);function A(e,t){let n=O(e);if(n===void 0)return k(t);let r=Object.hasOwn(t,n)?t[n]:void 0;return b(r)?r:[]}function j(e){if(e===void 0)return!1;try{return!!e()}catch{return!0}}function M(e,t){return new Promise(n=>{let r=()=>{clearTimeout(i),t.delete(r),n()},i=setTimeout(r,e);t.add(r)})}var N=(e,t,n,r)=>({ok:!1,...n===void 0?{}:{id:n},error:{code:e,message:t,...r===void 0?{}:{allowed:r}}});function P(e,t){let{withholds:n,secret:r}=e.handle,i=t===null?[]:[t];if(n!==void 0)try{let e=n(),t=(Array.isArray(e)?e:[e]).filter(e=>!!e);if(t.length>0)return t}catch{return i}return(r?.length??0)>0?i:[]}function F(n={}){let{confirm:r,policy:i={},settleMs:a=150}=n,o=new Set,s=new Set,l=!1,u=!1,d=Promise.resolve(),h=e(()=>[...s].forEach(e=>e()));function v(){let e=[];for(let n of t())try{let t=n.handle.element()??null,r={...n.handle.state()},i=f(t);e.push({entry:n,element:t,regions:P(n,t),state:r,name:i,policy:Object.freeze({id:n.id,member:n.handle.member,name:i,element:t})})}catch{}return e.sort((e,t)=>e.element===t.element?0:e.element===null||t.element===null?e.element===null?1:-1:e.element.compareDocumentPosition(t.element)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}function k(e){let t=new Set,n=new Set;typeof document<`u`&&n.add(document);for(let r of e){r.element&&n.add(r.element.ownerDocument);for(let e of r.entry.handle.secret??[])for(let n of C(r.state[e]))t.add(n)}for(let e of n)for(let n of e.querySelectorAll(`input[type="password"]`))t.add(n.value);return t.delete(``),[...t].sort((e,t)=>t.length-e.length)}let F=(e,t)=>e.element!==null&&t.some(t=>t!==e&&t.regions.some(t=>t.contains(e.element))),I=e=>e.filter(t=>t.element!==null&&t.element.isConnected&&t.element.closest(`[hidden]`)===null&&!F(t,e)&&!j(i.hide&&(()=>i.hide?.(t.policy))));function L(e,t){return(e.entry.handle.secret?.length??0)>0||e.element?.matches(`input[type="password"]`)===!0?``:T(p(e.element),t)}let R=e=>e.state.disabled===!0,z=e=>j(e.entry.handle.destructive);function B(e){if(R(e))return[];let t=[];for(let[n,r]of Object.entries(e.entry.handle.actions)){if(j(i.deny&&(()=>i.deny?.(e.policy,n))))continue;let a=D(r),o=O(r),s=(a===`id`||a===`ids`)&&A(r,e.state).some(e=>e.destructive===!0),c=z(e)||s;t.push({name:n,...a?{argument:a}:{},...o===void 0?{}:{among:o},...c?{confirm:!0}:{}})}return t}function V(e,t){let n=new Set(e.entry.handle.secret??[]),r={};for(let[i,a]of Object.entries(e.state))r[i]=n.has(i)||w(a,t)?{..._}:S(a);return r}function H(e,t){for(let n=e.element?.parentElement;n;n=n.parentElement){let e=t.get(n);if(e!==void 0)return e}}function U(){if(u)return{members:[]};let e=v(),t=k(e),n=I(e),r=new Map;for(let e of n)e.element&&!r.has(e.element)&&r.set(e.element,e.entry.id);return{members:n.map(e=>{let n=H(e,r),i=L(e,t);return{id:e.entry.id,member:e.entry.handle.member,name:T(e.name,t),...i===``?{}:{description:i},...n===void 0?{}:{within:n},state:V(e,t),actions:B(e)}})}}function W(e){if(u)return[];let t=v(),n=k(t),r=y(e)?e:{},i=e=>typeof e==`string`?E(e):void 0,a=i(r.name),o=i(r.text),s=i(r.member),l=(e,t)=>!t.includes(`\0`)&&E(T(e,n,`\0`)).includes(t),d=[];for(let e of I(t)){if(s!==void 0&&E(e.entry.handle.member)!==s||o!==void 0&&!l(c(e.element),o)&&!l(L(e,n),o))continue;let t={id:e.entry.id,member:e.entry.handle.member,name:T(e.name,n)};if((a===void 0||l(e.name,a))&&d.push(t),a===void 0)continue;let r=new Set(e.entry.handle.secret??[]);for(let[i,o]of Object.entries(e.state))if(!(r.has(i)||!b(o)||w(o,n)))for(let e of o)l(e.label,a)&&d.push({...t,option:{id:e.id,label:e.label}})}return d}function G(e,t){if(typeof e.id==`string`)return t.find(t=>t.entry.id===e.id)??N(`unknown-member`,`No member has the id "${e.id}".`,e.id);if(!y(e.target))return N(`unknown-member`,`The step names no member: give an id or a target.`);let{member:n,name:r}=e.target,i=t.filter(e=>(typeof n!=`string`||E(e.entry.handle.member)===E(n))&&(typeof r!=`string`||E(e.name)===E(r.trim()))),a=i.length>0||typeof r!=`string`?i:t.filter(e=>(typeof n!=`string`||E(e.entry.handle.member)===E(n))&&E(e.name).includes(E(r.trim())));return a.length===1?a[0]:a.length===0?N(`unknown-member`,`No member matches the target.`):N(`ambiguous-target`,`${a.length} members match the target. Name one by id: ${a.map(e=>e.entry.id).join(`, `)}.`)}function K(e,t,n,r,i){if(e===void 0)return t===void 0?void 0:`${r} takes no value.`;if(e===`boolean`)return typeof t==`boolean`?void 0:`${r} takes true or false.`;if(e===`number`)return typeof t==`number`&&Number.isFinite(t)?void 0:`${r} takes a number.`;if(e===`text`)return typeof t==`string`?void 0:`${r} takes text.`;let a=new Set(n.filter(e=>e.disabled!==!0).map(e=>e.id)),o=i===void 0?`the member's enabled choices`:`the enabled choices of "${i}"`;return e===`id`?typeof t==`string`&&a.has(t)?void 0:`${r} takes the id of one of ${o}.`:Array.isArray(t)&&t.every(e=>typeof e==`string`&&a.has(e))?void 0:`${r} takes a list of ids of ${o}.`}async function q(e){if(!y(e))return N(`invalid-value`,`A step is an object with a member and an action.`);let n=v(),c=k(n),u=G(e,I(n));if(`ok`in u)return u;let{id:d,handle:f}=u.entry,p=typeof e.action==`string`?e.action:``,h=Object.hasOwn(f.actions,p)?f.actions[p]:void 0,_=h!==void 0&&j(i.deny&&(()=>i.deny?.(u.policy,p)));if(h===void 0||_)return N(`not-allowed`,T(_?`The application does not allow ${p} on this member.`:`${f.member} has no action "${p}".`,c),d,B(u).map(e=>e.name));if(R(u))return N(`disabled`,`The member is disabled, so it allows no action.`,d);let b=D(h),C=A(h,u.state),E=K(b,e.value,C,p,O(h));if(E!==void 0)return N(`invalid-value`,E,d);let P=b===`id`?[e.value]:b===`ids`?e.value:[];if(z(u)||C.some(e=>e.destructive===!0&&P.includes(e.id))){if(r===void 0)return N(`needs-confirmation`,`${p} needs a person to confirm it, and the page asks no one.`,d);let n=!1;try{n=await r({id:d,member:f.member,name:T(u.name,c),action:p,...e.value===void 0?{}:{value:S(e.value)}})===!0}catch{n=!1}if(!n)return N(`declined`,`The person declined ${p}.`,d);if(!t().includes(u.entry))return N(`unknown-member`,`The member was removed while the person was asked.`,d)}let F=u.state;try{F={...f.state()}}catch{}let L=x(F);l=!0;try{let t=typeof h==`function`?h():h.run(e.value);t!==null&&typeof t?.then==`function`&&await t}catch(e){return N(`failed`,T(`${p} failed: ${e instanceof Error?e.message:String(e)}`,k(v())),d)}finally{l=!1}let V=Date.now(),H=F;for(let e=0;await M(e,s),t().includes(u.entry);e=g){try{H={...f.state()}}catch{break}if(x(H)!==L){await M(0,s);try{H={...f.state()}}catch{}break}if(Date.now()-V>=a)break}let U=(()=>{try{let e=f.element();if(e?.isConnected)return e}catch{}return u.element?.isConnected?u.element:null})(),W=[...new Set([...c,...k(v())])].sort((e,t)=>t.length-e.length),q=new Set(f.secret??[]),J={};for(let e of new Set([...Object.keys(F),...Object.keys(H)]))q.has(e)||x(F[e])===x(H[e])||w(F[e],W)||w(H[e],W)||(J[e]={from:S(F[e]),to:S(H[e])});let Y={id:d,member:f.member,action:p,changed:J,source:`agent`};for(let e of[...o])try{e(Y)}catch{}return(U?.isConnected?U:typeof document>`u`?null:document)?.dispatchEvent(new CustomEvent(m,{bubbles:!0,detail:Y})),{ok:!0,id:d,changed:J}}async function J(e){if(!Array.isArray(e))return{results:[N(`invalid-value`,`act takes a list of steps.`)]};let t=[];for(let n of e){let e=u?N(`unknown-member`,`The bridge is disposed.`):await q(n);if(t.push(e),!e.ok)break}return{results:t}}return{snapshot:U,query:W,act(e){let t=d.then(()=>J(e));return d=t.catch(()=>void 0),t.catch(()=>({results:[N(`failed`,`The bridge failed to run the steps.`)]}))},subscribe(e){return o.add(e),()=>{o.delete(e)}},get acting(){return l},dispose(){u=!0,h(),o.clear(),[...s].forEach(e=>e())}}}var I=e=>typeof e==`object`&&!!e&&!Array.isArray(e),L={polymorph_snapshot:e=>Promise.resolve(e.snapshot()),polymorph_query:(e,t)=>{let n=I(t)?t:{},r={};for(let e of[`name`,`text`,`member`]){let t=n[e];typeof t==`string`&&(r[e]=t)}return Promise.resolve({members:e.query(r)})},polymorph_act:(e,t)=>e.act(I(t)?t.steps:void 0)};function R(e){return r((t,n)=>L[t](e,n))}function z(e){return n(R(e),{by:`registerWebMCP`})}export{m as AGENT_CHANGE_EVENT,h as AGENT_SETTLE_MS,R as agentTools,F as createAgentBridge,z as registerWebMCP};
@@ -1,4 +0,0 @@
1
- import{A as e,J as t,P as n,U as r,Y as i,_ as a,j as o,k as s}from"./receivers-BpRfF6dV.js";import{t as c}from"./check-dOfCSYFA.js";import{t as l}from"./draw-DclRgiWM.js";var u=new Set([`children`,`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-required`]),d=[`icon`,`layout`,`controls`,`overlays`,`structure`,`charts`,`ai`,`archetypes`],f={icon:`Iconography`,layout:`Layout primitives`,controls:`Controls`,overlays:`Overlays`,structure:`Structure`,ai:`AI — the conversation`,archetypes:`Page archetypes`};function p(e,t=84){let n=e.match(/(?:`[^`]*`|[^\s`])+/g)??[],r=[],i=``;for(let e of n)i!==``&&i.length+1+e.length>t?(r.push(i),i=e):i=i===``?e:`${i} ${e}`;return i!==``&&r.push(i),r}var m=[...u].filter(e=>e.startsWith(`aria-`)),h=/^(?:React\.)?(?:ReactNode|ReactElement|ReactPortal)\b|^JSX\.Element\b/,g=/^(?:React\.)?[A-Z]\w*EventHandler(?:<.*>)?$/s,_=/^(?:React\.)?(?:Ref|RefObject|MutableRefObject|RefCallback)</,v=/(?:^|[^\w])(?:\w*Event|HTML\w*Element|Element)(?:<|$)/;function y(e){let t=e.trim();for(;t.startsWith(`(`)&&b(t,0)===t.length-1;)t=t.slice(1,-1).trim();return t}function b(e,t){let n=0;for(let r=t;r<e.length;r+=1){let t=e[r];if(`(<{[`.includes(t))n+=1;else if((`)}]`.includes(t)||t===`>`&&e[r-1]!==`=`)&&(--n,n===0))return r}return-1}function x(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i+=1){let a=e[i];`(<{[`.includes(a)?n+=1:`)}]`.includes(a)||a===`>`&&e[i-1]!==`=`?--n:a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}let i=e.slice(r).trim();return i!==``&&t.push(i),t}function S(e,t){let n=y(e);if(!n.startsWith(`(`))return null;let r=b(n,0);if(r===-1)return null;let i=n.slice(r+1).trim();return i.startsWith(`=>`)?`(${x(n.slice(1,r)).filter(e=>{let t=e.indexOf(`:`);return t===-1||!v.test(e.slice(t+1).trim())}).join(`, `)}) => ${C(i.slice(2),t)}`:null}function C(e,t){let n=e.replace(/\s+/g,` `).trim().replace(/\?: ([^;{}]+?) \| undefined;/g,`?: $1;`),r=S(n,t);if(r!==null)return r;let a=i(n);if(a.length===0)return`undefined`;let o=a.filter(e=>/^"[^"]*"$/.test(e)).map(e=>e.slice(1,-1));if(t.size>0&&o.length===a.length&&o.length===t.size&&o.every(e=>t.has(e)))return`IconRole`;let s=a.map(e=>{let n=y(e);return h.test(n)?`node`:g.test(n)?`() => void`:S(n,t)??n.replace(/^readonly /,``)}),c=s.includes(`false`)&&s.includes(`true`),l=s.includes(`node`),u=s.filter(e=>!(c&&(e===`false`||e===`true`))&&!(l&&(e===`string`||e===`number`)));c&&u.unshift(`boolean`);let d=[...new Set(u)];return d.map(e=>d.length>1&&e.includes(`=>`)?`(${e})`:e).join(`|`)}var w=/=> (?:void|undefined|Promise<(?:void|undefined)>)(?:\|(?:void|undefined|Promise<(?:void|undefined)>))*\)?$/;function T(e,t,n=!1){let r=e.filter(e=>!e.name.includes(`.`)&&!i(e.type).every(e=>_.test(e))),a=new Set(r.map(e=>e.name)),o=m.every(e=>a.has(e)),s=r.filter(e=>!(o&&m.includes(e.name))).map(e=>{let r=C(e.type,t),i=n&&D(e.type)&&!w.test(r);return`${e.name}${e.optional?``:`*`}: ${i?`fn`:r}`});return o?[...s,`aria-*`]:s}function E(e,n,r){let i=T(e.props,r);e.grid!==null&&i.push(`cells: ${Object.entries(e.grid).map(([e,t])=>`${e}(${t.join(`|`)})`).join(` `)}`);let a=e.purpose===``?``:` — ${e.purpose}`,o=[`- **${e.name}**${a}${i.map(e=>` · ${e}`).join(``)}`];for(let i of t(e,`web`,n)){let t=e.parts.find(e=>e.name===i.name);if(t===void 0)continue;let n=T(t.props,r);o.push(` - **${e.name}.${i.name}**${n.length===0?``:` · ${n.join(` · `)}`}`)}return o}function D(e){let t=e.replace(/\s+/g,` `).trim();if(S(t,new Set)!==null)return!0;let n=i(t);return n.length>0&&n.every(e=>S(e,new Set)!==null||g.test(y(e)))}function O(e,n,r,i,a){let o=new Map((e.dataTypes??[]).map(e=>[e.name,e]));if(o.size===0)return[];let s=new Set,c=[],l=e=>{if(!D(e))for(let t of e.match(/\b[A-Z][A-Za-z0-9]*\b/g)??[])o.has(t)&&!s.has(t)&&(s.add(t),c.push(t))};for(let e of n){for(let t of e.props)t.name.includes(`.`)||l(t.type);for(let n of t(e,`web`,i)){let t=e.parts.find(e=>e.name===n.name);for(let e of t?.props??[])l(e.type)}}for(let e of r)for(let t of e.props)l(t.type);for(let e=c.shift();e!==void 0;e=c.shift()){let t=o.get(e);for(let e of t?.union??[])l(e);for(let e of t?.fields??[])l(e.type)}if(s.size===0)return[];let u=new Set(n.map(e=>e.name)),d=[...o.values()].filter(e=>s.has(e.name)).map(e=>{let t=`**${e.name}${e.params.length===0?``:`<${e.params.join(`, `)}>`}**`;if(e.union!==void 0)return`- ${t} = ${e.union.join(` | `)}`;let n=e.name.endsWith(`Props`)?e.name.slice(0,-5):``;return u.has(n)?`- ${t} · the props of \`${n}\``:`- ${t}${T(e.fields,a,!0).map(e=>` · ${e}`).join(``)}`});return[`### Data types`,``,...p('A prop typed with one of these takes an object: write it as `{ "$object": { … } }` with the fields listed, `*` marking a required one, or bind the prop to an input that holds it. A `node` field takes an element. A function field cannot be written as a value: one shown by its signature returns nothing and takes a binding to an action input of that type; one shown as `fn` returns a value, and a document cannot give it.',96),``,...d,``]}function k(e,t){let{framework:n,members:r}=t,i=new Set(e.icons.roles.map(e=>e.name)),a=e.components.filter(e=>r.has(e.name)),o=[`## Members`,``,...p(`One line per member: what it is for, then its props as \`name: type\`, \`*\` marking a required one, then its lawful variant × tone \`cells\`; a part (\`Member.Part\`) is a line under its member. \`node\` is an element, a text, or a list of them. A function type is a callback: bind it to an input of that type. \`aria-*\` stands for four props, each written under its own name (${m.map(e=>`\`${e}\``).join(`, `)}); no member has a prop named \`aria\`. A member takes no prop it does not list, and takes children only where it lists \`children\`.`,96),``],s=[...new Set([...d,...a.map(e=>e.tier)])];for(let e of s){let t=a.filter(t=>t.tier===e);if(t.length!==0){o.push(`### ${f[e]??e}`,``);for(let e of t)o.push(...E(e,n,i));o.push(``)}}let c=e.exceptions.primitives.filter(e=>r.has(e.name));if(c.length>0){o.push(`### Declared exceptions`,``);for(let e of c){let t=T(e.props,i);o.push(`- **${e.name}** (rung ${e.rung}) — ${e.purpose}`+t.map(e=>` · ${e}`).join(``))}o.push(``)}return o.push(...O(e,a,c,n,i)),o.some(e=>e.includes(`IconRole`))&&o.push(`### Icon roles`,``,...p(`An \`IconRole\` is a meaning, never a glyph name, and one of: ${e.icons.roles.map(e=>e.name).join(`, `)}.`,96),``),o.join(`
2
- `)}var A=e=>e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`,j=e=>`\`${e}\``,M=[`# Writing a screen`,``,`You write one screen as a document that names members of a closed vocabulary, their props and`,`what they hold. The host draws it at once, in its own theme: every colour, space, size and motion`,`is the theme’s, so a document has no field for a style, a class or an expression. Choose members`,`and variants; bind content to the inputs the host hands the screen.`,``].join(`
3
- `);function N(t={}){let i=t.vocabulary??s,a=n(i,t),c=i.exceptions.primitives.filter(e=>a.has(e.name)),l=i.components.filter(e=>a.has(e.name)).filter(e=>e.props.some(e=>e.name===`patch`)).map(e=>j(e.name)),u=[...c.map(e=>`${j(e.name)} is rung ${e.rung}`),...l.length===0?[]:[`a ${j(`patch`)} prop (on ${A(l)}) is rung 3`]],d=A([...e].map(j)),f=o.map(j),p=[`## What you write`,``,`Answer with one document in the ${j(r)} format, as JSON in one fenced \`json\``,"block. The host draws it while it arrives, so write its keys in this order: `spec`, `name`,","`purpose`, `inputs`, and `root` last.",``,`- ${j(`spec`)} is ${j(JSON.stringify(r))}. ${j(`name`)} is a PascalCase name for the screen that no member has.`,` ${j(`purpose`)} is one sentence.`,'- `inputs` lists what the host hands the screen, each `{ "name": …, "type": … }`. A data input is'," named for a key of the host’s data, and its `type` is a TypeScript type (`string`, `Order[]`);",` an input the host has no value for is empty. An input whose type is a function that returns`," nothing (`(id: string) => void`) is an action: when a member calls it, the host is told its",` name, its arguments and the value of every named control. Bind each callback prop the person`,` acts through to an action input of the callback’s type. A function that returns a value`," (`(row: Row) => string`) is answered with an empty answer and the host is never told.",'- `root` is an element: `{ "component": …, "props": { … }, "children": [ … ] }`, `props` and'," `children` left out when empty. `component` is a member or a part (`Member.Part`) listed"," above. Every prop goes inside `props`, and a member takes no prop and no child it does not list."," Write an element’s plain props before its props that hold elements, and `props` before"," `children`: the screen is drawn as it is written, and an element is drawn once its plain",` props are whole.`,"- A value is a string, a number, a boolean, `null`, an element, a list of values, a binding",' `{ "$": "input" }` or `{ "$": "input.field" }`, or a structured object `{ "$object": { … } }`',` (an option, a column). A binding names a declared input and is never an expression.`,`- There is no condition and no loop: every element is drawn whenever the screen is. Content that`,` is sometimes absent is a prop bound to an input that is empty while there is nothing to show.`,"- A control with a `name` reports its current value under that name with every action, so name",` each field a person fills in. A name is used once in a screen: two forms on one screen name`," their fields apart (`signInEmail`, `signUpEmail`), because one name holds one value.",`- An address (${d}) is relative, a fragment, or ${f.slice(0,-1).join(`, `)} or ${f.at(-1)??``}.`];return u.length>0&&p.push(`- A declared exception: ${A(u)}. An element that is one carries`,' `"exception": { "rung": …, "because": "…" }`, the reason in four words or more; no other'," element has `exception`."),`${p.join(`
4
- `)}\n`}function P(e={}){let t=e.vocabulary??s;return`${M}\n${k(t,{framework:e.framework??`react`,members:n(t,e)})}\n${N(e)}`}function F(e,t={}){let n=t.document,r=t.members,i=l(e,t);return{get values(){return i.values},get changed(){return i.changed},get faults(){return i.faults},update(e){`document`in e&&(n=e.document),i.update(e)},check(){return c(n,r===void 0?{}:{members:r})},dispose(){i.dispose()}}}function I(e={}){return P({...e,framework:`elements`})}function L(e={}){return N({...e,framework:`elements`})}export{c as checkScreen,F as drawScreen,L as outputContract,a as parsePartial,I as runtimeCard};
@@ -1 +0,0 @@
1
- var e={avatar:`_avatar_7igiy_6`,image:`_image_7igiy_20 _fadeIn_lkjqs_92`,initials:`_initials_7igiy_31`,group:`_group_7igiy_105`,surplus:`_surplus_7igiy_115`};export{e as t};
@@ -1 +0,0 @@
1
- import{s as e}from"./src-Bub3C9YP.js";function t(t){if(t===null)return null;let n=getComputedStyle(t).getPropertyValue(e(`chart.cap`)),r=Number.parseInt(n,10);return Number.isFinite(r)&&r>0?r:null}export{t};
@@ -1 +0,0 @@
1
- import{C as e,b as t,g as n,h as r,u as i,y as a}from"./chart-twin.module-Cks7VwS5.js";import{d as o,i as s,n as c,o as l,r as u,u as d}from"./cartesian-I5uPfyqv.js";import{c as f,i as p,l as m,n as h,o as g,s as _}from"./chart-annotations.module-xUExw4pu.js";import{n as v,t as y}from"./paths-gMbgdf4z.js";import{a as b,l as x,n as S,o as C,r as w}from"./series-C_1TNd2n.js";function T(e,t){let n=t.state(e.walk.count);return n===null?{start:null,end:null}:{start:n.anchor,end:n.edge}}function E(e,t,n,r){let{count:i}=e.walk;if(e.input.brushable!==!0)throw Error(`The chart has no brush, because it takes no onBrushEnd.`);if(!e.model.brushOn)throw Error(`The chart has no brush, because its x is not one this chart brushes.`);if(!Number.isInteger(t)||t<0||t>=i)throw Error(i<=0?`The chart has no rows to brush.`:`The chart's rows are 0 to ${i-1}, and ${t} is not one of them.`);let a=r.now().index,o=n.state(),s=o!==null&&!o.committed?o.anchor:null,c=a===null?t>0:t>a;if((s??a??(c?0:i-1))===t)throw Error(`A range runs between two rows, and this one would start and end on row ${t}.`);let l=c?`ArrowRight`:`ArrowLeft`;for(let e=0;r.now().index!==t&&e<=i&&n.key(l,!0,r);e+=1);if(!n.key(`Enter`,!1,r))throw Error(`The chart's brush did not commit a range ending on row ${t}.`)}function D(e,t,n,r){return r?e.map(e=>{let r=e[t];if(n===`linear`)return typeof r==`number`&&Number.isFinite(r)?r:null;let i=typeof r==`string`?a(r):null;return i===null?null:i.getTime()}):e.map(()=>null)}function O(e,t){return t===null?null:e.domainValues[t]??void 0}function k(e,t){if(t===null)return null;let n=r(e.domainValues,t);return n===-1?void 0:n}function A(r){let{data:a,series:p,x:h,y:T,variant:E=`line`,markers:O=!1,curve:k=`monotone`,emphasis:A,baseline:j,annotations:M,label:N,locale:P,messages:F=e,loading:I=!1,selectable:L=!1,brushable:R=!1,syncId:z,hidden:B,box:V}=r,H=C(p),U=w(H.series,A),W=S(p,A),G=U.filter(e=>!(B?.has(e.key)??!1)),K=h.scale??d(a,h.key),q=K===`time`||K===`linear`,J=R&&q,ee=z!==void 0&&q,Y=[];H.warnings.length>0&&Y.push(H.warnings.join(` `)),W!==void 0&&Y.push(W),R&&!q&&Y.push(`onBrushEnd needs a time or linear x — a band has no continuum to select a range of. No brush.`),z!==void 0&&!q&&Y.push(`syncId needs a time or linear x — the broadcast is an x-domain value, and a band has none. Not synced.`);let X=c({data:a,x:h,kind:K,y:T,series:G,locale:P,messages:F,plot:V,domainMode:T?.domain??`auto`,...G.length===0?{valueOverride:o(a,U.map(e=>e.key))}:{}}),Z=u(a,h,K,P,F,X?.categoryStep??0),Q=X?.positions??[],$=null;if(X!==null&&V!==null){let e=a.length===0||j===void 0&&(M===void 0||M.length===0)?null:m({annotations:M,baseline:j,valueAt:e=>X.value.at(e),categoryAt:X.categoryAt,vertical:!0}),t=e===null?null:f(e,`y`,V.width,V.height),r=X.value.at(X.value.domain[0]),o=G.map(e=>{let t=a.map((t,n)=>{let r=x(t,e.key),i=Q[n];return r===null||i==null?null:{x:i,y:X.value.at(r)}});return{key:e.key,paint:e.paint,wash:E===`area`?y(t,r,k):null,line:v(t,k),markers:O?t.flatMap((t,n)=>t===null?[]:[{key:`${e.key}-${n}`,index:n,cx:t.x,cy:t.y,r:4}]):[]}}),c=a[a.length-1],l=a.length===0?[]:s(a,G,e=>x(c,e),e=>X.value.at(e),T?.format,P);$={width:V.width,height:V.height,grid:X.valueTicks.map(e=>({key:e.key,d:n([0,i(e.at)],[V.width,i(e.at)])})),zeroRule:X.hasZero?n([0,i(X.zero)],[V.width,i(X.zero)]):null,wash:t?.wash??[],ink:t?.ink??null,strokes:o,endLabels:l.map(e=>({key:e.key,x:V.width,y:e.baseline,text:e.text}))}}return{state:t(a,I),kind:K,painted:U,visible:G,categories:Z,brushOn:J,syncGroup:ee?z:void 0,domainValues:D(a,h.key,K,q),summary:l(F,N,U,a.length,L),warnings:Y,legend:b(U)!==null,twin:{columns:g(h,U),rows:_(a,Z,U,T?.format,P)},axes:X===null||a.length===0?null:{y:X.valueTicks,x:X.categoryTicks},positions:Q,plot:$}}function j(e,t,r){let a=e.positions[t]??0;return{x:a,y:r.height/2,side:a>r.width/2?`start`:`end`,crosshair:n([i(a),0],[i(a),r.height])}}function M(t,n,r){let{data:i,y:a,locale:o,tooltip:s={},box:c}=t,l=t.messages??e;if(r.index===null)return{rows:[],announcement:``,tooltip:null,crosshair:null};let u=p(i,r.index,n.visible,a?.format,o,l.noData),d=n.categories[r.index]??``,f=n.plot===null||c===null?null:j(n,r.index,c);return{rows:u,announcement:h(d,u),tooltip:s===!1||!r.active||f===null||u.length===0?null:{...s.hideLabel?{}:{header:d},rows:u,indicator:s.indicator??`dot`,x:f.x,y:f.y,side:f.side},crosshair:r.active&&f!==null?f.crosshair:null}}function N(e,t,n){if(n.index===null)return null;let r=e.data[n.index];return r===void 0?null:{index:n.index,datum:r}}function P(e,t){if(t===null||e.plot===null)return null;let n=e.positions[t.anchor],r=e.positions[t.edge];return n==null||r==null?null:{from:n,to:r,height:e.plot.height}}function F(e,t,n,r){let{data:i,x:a}=e,[o,s]=[n,r].sort((e,n)=>(t.domainValues[e]??0)-(t.domainValues[n]??0));return o===void 0||s===void 0?null:t.kind===`time`?[String(i[o]?.[a.key]??``),String(i[s]?.[a.key]??``)]:[Number(i[o]?.[a.key]??0),Number(i[s]?.[a.key]??0)]}var I=(e,t)=>Math.min(t,Math.max(0,e));function L(e){let t=e,n=null,i=new Set,a=(e=t.count)=>n!==null&&n.of===e?n:null,o=e=>{n=e===null?null:{...e,of:t.count};for(let e of[...i])e()},s=null,c=!1,l=!1;return{state:e=>a(e),update:e=>{t=e},key:(e,n,r)=>{let i=a();if(e===`Escape`&&i!==null)return o(null),!0;let{enabled:s,count:c}=t;if(!s||c===0)return!1;if(n&&(e===`ArrowRight`||e===`ArrowLeft`)){let t=e===`ArrowRight`?1:-1,n=r.now().index,a=n===null?t>0?0:c-1:I(n+t,c-1),s=i!==null&&!i.committed?i.anchor:n??a;return o({anchor:s,edge:a,committed:!1}),r.moveTo(a),!0}return e===`Enter`&&i!==null&&!i.committed&&i.anchor!==i.edge?(t.onCommit(i.anchor,i.edge),o({...i,committed:!0}),!0):!1},pointerDown:e=>{if(!t.enabled)return;let n=r(t.positions,e);s=n===-1?null:n,c=!1},pointerMove:e=>{let n=s;if(n===null||n>=t.count)return;let i=r(t.positions,e);if(i===-1||!c&&i===n)return;c=!0;let l=a();l!==null&&l.anchor===n&&l.edge===i&&!l.committed||o({anchor:n,edge:i,committed:!1})},pointerUp:()=>{let e=a();c&&e!==null&&!e.committed&&(e.anchor===e.edge?o(null):(t.onCommit(e.anchor,e.edge),o({...e,committed:!0}),l=!0)),s=null,c=!1},consumeClick:()=>{let e=l;return l=!1,e},blur:()=>{s=null,c=!1;let e=a();e!==null&&!e.committed&&o(null)},subscribe:e=>(i.add(e),()=>{i.delete(e)})}}var R=new Map;function z(e){let t=null,n=()=>{if(t===null)return;let e=R.get(t.id);e?.delete(t.entry),e?.size===0&&R.delete(t.id),t=null};return{join:(r,i=null)=>{if(t!==null&&t.id===r&&t.entry.anchor===i&&R.get(t.id)?.has(t.entry)===!0||(n(),r===void 0))return;let a={listener:t=>e(t),anchor:i},o=R.get(r);o||R.set(r,o=new Set),o.add(a),t={id:r,entry:a}},leave:n,broadcast:e=>{if(t===null)return;let{id:n,entry:r}=t;for(let t of[...R.get(n)??[]])t!==r&&(t.anchor!==null&&!t.anchor.isConnected||t.listener(e))}}}var B={range:`_range_10edz_9`,edge:`_edge_10edz_14`};export{F as a,A as c,k as d,O as f,P as i,M as l,T as m,z as n,j as o,E as p,L as r,D as s,B as t,N as u};
@@ -1 +0,0 @@
1
- import"./src-Bub3C9YP.js";import{a as e,o as t}from"./CalendarDate-B7bbrT1-.js";function n(e,t){let{seriesCount:n=1,walkSeries:r=!1,seriesStart:i=null}=e;return!r||n<=1?[{id:String(t),at:{index:t,series:i}}]:Array.from({length:n},(e,n)=>({id:`${t}:${n}`,at:{index:t,series:n}}))}function r(e,t){return n(e.walk,t).filter(t=>e.selection(e.input,e.model,t.at)!==null)}function i(e,t){let{count:n}=e.walk,i=r(e,t),a=[],o=[],s=i.length,c=t-1,l=t+1,u=c>=0,d=l<n,f=`after`;for(;u||d;){let t=f===`after`&&d||!u?`after`:`before`;f=t===`after`?`before`:`after`;let i=r(e,t===`after`?l:c);if(s+i.length>40){t===`after`?d=!1:u=!1;continue}s+=i.length,t===`after`?(o.push(i),l+=1,d=l<n):(a.unshift(i),--c,u=c>=0)}return[...a.flat(),...i,...o.flat()]}function a(e,t){let{index:n}=t.now(),{count:r}=e.walk;return n===null||r<=0?null:Math.min(r-1,Math.max(0,n))}function o(e,t){return e.walk.count<=0?[]:i(e,(t===void 0?null:a(e,t))??0).map(({id:t,at:n})=>({id:t,label:e.readout(e.input,e.model,{...n,active:!0}).announcement}))}function s(e,t,n){let{count:r}=e.walk;if(!Number.isInteger(t)||t<0||t>=r)throw Error(r<=0?`The chart has no positions to read.`:`The chart's positions are 0 to ${r-1}, and ${t} is not one of them.`);n.moveTo(t,n.now().series)}function c(e,t,n,i){let a=Number(t.split(`:`)[0]),o=Number.isInteger(a)&&a>=0&&a<e.walk.count?r(e,a).find(e=>e.id===t):void 0;if(o===void 0)throw Error(`No mark of the chart has the id "${t}".`);n.moveTo(o.at.index,o.at.series),i()}function l(e){return e.length<2?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e.at(-1)}`}var u=(e,t,n)=>e===1?`1 ${t}`:`${e} ${n}`,d=`The same data is available as a table.`,f={summary:({label:e,series:t,points:n})=>`${e}${t.length===0?``:` showing ${l(t)}`}, ${u(n,`point`,`points`)}. ${d}`,donutSummary:({label:e,segments:t})=>`${e}, ${u(t,`segment`,`segments`)}. ${d}`,heatmapSummary:({label:e,grid:t})=>t===void 0?`${e}. ${d}`:`${e}, ${t.rows} rows by ${t.columns} columns. ${d}`,radarSummary:({label:e,axes:t,series:n,max:r})=>`${e}, ${t} axes by ${n} series, one shared scale from zero to ${r}. ${d}`,funnelSummary:({label:e,stages:t})=>`${e}, ${u(t,`stage`,`stages`)}. ${d}`,treemapSummary:({label:e,items:t,groups:n,absent:r})=>`${e}, ${u(t,`item`,`items`)}${n===0?``:` in ${u(n,`group`,`groups`)}`}.${r===0?``:` ${r===1?`1 has`:`${r} have`} no positive value and ${r===1?`is`:`are`} not drawn.`} ${d}`,activationHint:`Enter or Space selects the current reading.`,empty:`No data yet`,noData:`No data`,showTable:e=>`Show the data table for ${e}`,hideTable:e=>`Hide the data table for ${e}`,tableLabel:e=>`${e} — data`,segmentColumn:`Segment`,valueColumn:`Value`,shareColumn:`Share`,rangeColumn:`Range`,countColumn:`Count`,stageColumn:`Stage`,continuedColumn:`Continued`,continued:e=>`${e} continued`,groupColumn:`Group`,itemColumn:`Item`,quarter:e=>`Q${e}`},p={...f,empty:`No data in this range`},m={...f,empty:`No activity in this range`};function h(e,t,n){return n?`${e} ${t.activationHint}`:e}function g(e,t){return t?`loading`:e.length===0?`empty`:`ready`}var _=/^\d{4}-\d{2}-\d{2}$/;function v(n){try{return _.test(n)?e(n).toDate(y()):t(n).toDate()}catch{let e=new Date(n);return Number.isNaN(e.getTime())?null:e}}function y(){return Intl.DateTimeFormat().resolvedOptions().timeZone}var b=new Map,x=new Map;function S(e,t){let n=`${e??``}|${JSON.stringify(t)}`,r=b.get(n);return r||(r=new Intl.NumberFormat(e,t),b.set(n,r)),r}function C(e,t){let n=`${e??``}|${JSON.stringify(t)}`,r=x.get(n);return r||(r=new Intl.DateTimeFormat(e,t),x.set(n,r)),r}function w(e){let t=e?.maximumFractionDigits;switch(e?.style){case`compact`:return{notation:`compact`,maximumFractionDigits:t??1};case`percent`:return{style:`percent`,maximumFractionDigits:t??0};case`currency`:return{style:`currency`,currency:e.currency??`USD`,...t===void 0?{}:{maximumFractionDigits:t}};default:return t===void 0?{}:{maximumFractionDigits:t}}}var T={day:{month:`short`,day:`numeric`},week:{month:`short`,day:`numeric`},month:{month:`short`},quarter:{},year:{year:`numeric`}};function E(e,t,n,r){return t===`quarter`?r.quarter(Math.floor(e.getMonth()/3)+1):C(n,T[t]).format(e)}function D(e,t,n,r=f){if(e===null)return``;if(typeof e==`number`)return Number.isFinite(e)?S(n,w(t)).format(e):``;if(t?.style===`date`){let i=v(e);return i===null?e:E(i,t.granularity??`day`,n,r)}return e}var O=864e5;function k(e){return e>=300*O?`year`:e>=80*O?`quarter`:e>=27*O?`month`:e>=6*O?`week`:`day`}function A(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=e[i];if(a==null)continue;let o=Math.abs(a-t);o<r&&(r=o,n=i)}return n}function j(e,t,n,r=24){let i=-1,a=r*r;for(let r=0;r<e.length;r+=1){let o=e[r];if(o==null)continue;let s=o.x-t,c=o.y-n,l=s*s+c*c;l<a&&(a=l,i=r)}return i}function M(e,t,n=24){let r=Math.max(t,n);return{start:e-r/2,size:r}}function N(e,t,n){let r=t+n;return r<=0?1:Math.max(1,Math.floor(e/r))}function P(e,t){return e.length*t*.6}function F(e,t,n,r,i,a=4){let o=Math.max(0,n),s=Math.max(0,r),c=Math.max(0,Math.min(a,o/2,s/2)),[l,u]=[e+o,t+s];switch(i){case`top`:return`M${e} ${u}L${e} ${t+c}A${c} ${c} 0 0 1 ${e+c} ${t}L${l-c} ${t}A${c} ${c} 0 0 1 ${l} ${t+c}L${l} ${u}Z`;case`bottom`:return`M${e} ${t}L${e} ${u-c}A${c} ${c} 0 0 0 ${e+c} ${u}L${l-c} ${u}A${c} ${c} 0 0 0 ${l} ${u-c}L${l} ${t}Z`;case`right`:return`M${e} ${t}L${l-c} ${t}A${c} ${c} 0 0 1 ${l} ${t+c}L${l} ${u-c}A${c} ${c} 0 0 1 ${l-c} ${u}L${e} ${u}Z`;default:return`M${l} ${t}L${e+c} ${t}A${c} ${c} 0 0 0 ${e} ${t+c}L${e} ${u-c}A${c} ${c} 0 0 0 ${e+c} ${u}L${l} ${u}Z`}}function I(e,t){return`M${e[0]} ${e[1]}L${t[0]} ${t[1]}`}function L(e,t=1){return t%2==0?Math.round(e):Math.round(e)+.5}function R(e,t){return e===t||e!==null&&t!==null&&e.width===t.width&&e.height===t.height}function z(e,t=null){let n={width:e.clientWidth,height:e.clientHeight};return t!==null&&R(t,n)?t:n}var B=(e,t)=>Math.min(t,Math.max(0,e));function V(e=null){return{index:null,series:e}}function H(e,t,n=1){return{index:e.index===null?null:B(e.index,Math.max(0,t-1)),series:e.series===null?null:B(e.series,Math.max(0,n-1)),active:e.index!==null&&t>0}}function U(e){let t={seriesCount:1,walkSeries:!1,seriesStart:null,wrap:!1,...e},n=V(t.seriesStart),r=new Set,i=e=>{let t=n;if(!(t.index===e.index&&t.series===e.series)){n=e;for(let n of[...r])n(e,t)}},a=(e,n=t.seriesStart)=>{i({index:e,series:n})},o=()=>{n.index!==null&&i(V(t.seriesStart))};return{now:()=>n,update:e=>{t={seriesCount:1,walkSeries:!1,seriesStart:null,wrap:!1,...e}},moveTo:a,clear:o,key:e=>{let{count:r,seriesCount:a,walkSeries:s,wrap:c}=t;if(r===0)return!1;let l=n,u=e=>(i({...l,index:l.index===null?e>0?0:r-1:c?((l.index+e)%r+r)%r:B(l.index+e,r-1)}),!0);switch(e){case`ArrowRight`:return u(1);case`ArrowLeft`:return u(-1);case`Home`:return i({...l,index:0}),!0;case`End`:return i({...l,index:r-1}),!0;case`ArrowUp`:case`ArrowDown`:{if(!s||a<=1||l.index===null)return!1;let t=e===`ArrowUp`?-1:1;return i({...l,series:l.series===null?t>0?0:a-1:B(l.series+t,a-1)}),!0}case`Escape`:return l.index===null?!1:(o(),!0);default:return!1}},subscribe:e=>(r.add(e),()=>{r.delete(e)})}}function W(){let e=new Set;return{log:(t,n)=>{let r=new Set(t);for(let t of r)e.has(t)||n(t);e=r}}}var G={frame:`_frame_1loa5_8`,"chart-frame-enter":`_chart-frame-enter_1loa5_1`,region:`_region_1loa5_44`,yAxis:`_yAxis_1loa5_60`,plot:`_plot_1loa5_66`,xAxis:`_xAxis_1loa5_78`,plotSurface:`_plotSurface_1loa5_97 _focusRing_1hr3n_49`,empty:`_empty_1loa5_112`},K={tooltip:`_tooltip_1h0rx_8`,header:`_header_1h0rx_43`,rows:`_rows_1h0rx_51`,row:`_row_1h0rx_51`,key:`_key_1h0rx_70`,value:`_value_1h0rx_89`,label:`_label_1h0rx_97`},q={twin:`_twin_33yqx_7`,toggle:`_toggle_33yqx_13`,table:`_table_33yqx_22`};export{p as C,c as D,a as E,s as O,m as S,o as T,D as _,U as a,g as b,z as c,P as d,M as f,I as g,A as h,W as i,F as l,j as m,K as n,V as o,N as p,G as r,H as s,q as t,L as u,k as v,h as w,f as x,v as y};
@@ -1 +0,0 @@
1
- import{d as e}from"./Icon-BjPIXI8I.js";import{A as t,B as n,E as r,F as i,G as a,H as o,I as s,J as c,K as l,L as u,M as d,N as f,O as p,P as m,R as h,V as g,W as _,Z as v,b as y,c as b,d as x,f as S,g as C,h as w,i as ee,k as te,l as ne,m as re,n as ie,o as ae,p as oe,r as se,s as ce,t as le,u as T,z as ue}from"./receivers-BpRfF6dV.js";var de=`solid`,fe=`accent`,pe=`danger`;function me(e,t){let n=e===void 0?de:e,r=t===void 0?fe:t;return n!==null&&n!==`solid`||r!==null&&r!==`accent`?!1:n===null||r===null?null:!0}function E(e){return e===null?null:e===pe}var he={Dialog:{kind:`dialog`,outside:[`trigger`]},Drawer:{kind:`dialog`,outside:[]},Popover:{kind:`dialog`,outside:[`trigger`]},Card:{kind:`section`,outside:[]},"Dashboard.Panel":{kind:`section`,outside:[]}};function ge(e){let t=e.replace(`.`,``);for(let[e,n]of Object.entries(he))if(e.replace(`.`,``)===t)return{name:e,scope:n};return null}function _e(e,t){return e.some(([e,n])=>t.some(([t,r])=>e===t&&n!==r))}function ve(e){let t=[];return e.forEach((n,r)=>{e.slice(0,r).some(e=>!_e(e,n))&&t.push(r)}),t}function ye(e,t){let n=[[]];for(let r of e)t(r)?n.push([]):n[n.length-1]?.push(r);return n.filter(e=>e.length>0)}function be(e){let t=[];return e.forEach((n,r)=>{n.some(e=>E(e)===!0)&&e.slice(r+1).some(e=>e.some(e=>E(e)===!1))&&t.push(r)}),t}function xe(e,t){return t.includes(e)}var D=[2,3,4],O=new Set([`break case catch class const continue debugger default delete do else enum export extends`,`false finally for function if import in instanceof new null return super switch this throw`,`true try typeof var void while with`,`await implements interface let package private protected public static yield`,`arguments eval`].flatMap(e=>e.split(` `))),Se=`patch`,Ce='a binding is `{ "$": "anInput" }`, an element is `{ "component": … }`, and a plain object, such as a column or an option, is written `{ "$object": { … } }`';function we(e,t,n={},r={}){let i=M(t,`$`);if(i.length>0)return{ok:!1,faults:i};let s=new Map(e.components.map(e=>[e.name,e])),c=new Map(e.exceptions.primitives.map(e=>[e.name,e])),u=N(t,`$`,e=>H(e,s,c)),d=v(o,t).map(e=>{let[t=`$`,...n]=e.split(`: `),r=n.join(`: `);return{path:t,message:u.get(t)??(r.startsWith(`an object here has `)?`${r} — ${Ce}`:r)}});if(d.length>0)return{ok:!1,faults:d};let f=t,p=f.platform??`web`,m=r.framework??`react`,h=[];m!==`react`&&p!==`web`&&h.push({path:`$.platform`,message:`${/^[aeiou]/.test(m)?`an`:`a`} ${m} screen runs on the web, and this one names ${p} — remove \`platform\`, or validate it without a framework`});let g=new Set(f.inputs.map(e=>e.name)),y=new Set,b=new Set;k(f,h),Ee(f,h,n.inputType),Ae(f,h);let x=(t,n,r)=>{if(Array.isArray(t)){let e=r||t.some(e=>!Array.isArray(e)&&a(e));t.forEach((t,r)=>x(t,`${n}[${r}]`,e));return}if(_(t)){let[e]=t.$.split(`.`);(e===void 0||!g.has(e))&&h.push({path:n,message:`\`${t.$}\` binds to "${e}", which the screen does not declare as an input`});return}if(l(t)){if(r){h.push({path:n,message:`a structured object is data, and this is a place where things are drawn — a child, or a list that holds an element. Pass it to the prop that takes it`});return}J(e,t.$object,n,h);for(let[e,r]of Object.entries(t.$object))x(r,`${n}.${e}`,!1);return}a(t)&&S(t,n)},S=(t,n)=>{let r=t.props??{},i=B(H(t.component,s,c),t.component,p);if(y.add(t.component.split(`.`)[0]??t.component),b.add(t.component),i===null)h.push({path:n,message:`no component called \`${t.component}\``+(Ke(t.component,s,p,m)??Qe(e,t.component,s,c))});else{qe(t,i,p,n,h),Je(t,i,m,n,h);let a=G(t.component,i,p,m);a!==null&&h.push({path:n,message:a});for(let e of Object.keys(r))i.props.has(e)||h.push({path:`${n}.props.${e}`,message:`\`${t.component}\` has no prop \`${e}\`${et(e,i.props)}`});for(let[e,a]of Object.entries(r)){let r=i.types.get(e);if(!r)continue;let o=Ye(r.type,a);o!==null&&h.push({path:`${n}.props.${e}`,message:`\`${t.component}\` prop \`${e}\` wants \`${r.type}\`, got ${o}`})}for(let[e,a]of i.types)a.optional||e===`children`||e in r||h.push({path:n,message:`\`${t.component}\` is missing its required prop \`${e}\``});i.component&&i.part===void 0&&Xe(i.component,r,n,h),J(e,r,n,h),t.children!==void 0&&!i.props.has(`children`)&&h.push({path:n,message:`\`${t.component}\` takes no children`})}X(t,i,n,h);for(let[e,t]of Object.entries(r))x(t,`${n}.props.${e}`,!1);(t.children??[]).forEach((e,t)=>x(e,`${n}.children[${t}]`,!0))};return S(f.root,`$.root`),Ze(f.root,e.icons.trailing,h),Pe(f,Ne(y,b,m),h),P(p)&&We(f,p,s,c,h,n),{ok:h.length===0,faults:h}}function k(e,t){let n=new Set;e.inputs.forEach((e,r)=>{let i=`$.inputs[${r}].name`;O.has(e.name)&&t.push({path:i,message:`\`${e.name}\` is a word the language has taken — the emitted component destructures its inputs, and no parameter can be called that`}),n.has(e.name)&&t.push({path:i,message:`\`${e.name}\` is declared twice — the props interface would hold one field and the destructuring two identifiers of the same name`}),n.add(e.name)})}function A(e){return e.length<=1?e.join(``):`${e.slice(0,-1).join(`, `)} and ${e[e.length-1]}`}function j(e){let t=e.replace(/\s+/g,` `);return t.length<=60?t:`${t.slice(0,57)}…`}function M(e,t){if(Array.isArray(e))return e.flatMap((e,n)=>M(e,`${t}[${n}]`));if(typeof e!=`object`||!e)return[];let n=e,r=n.$;return typeof r==`string`&&!g.test(r)?[{path:t,message:`\`${j(r)}\` is not a binding — a binding names an input and, with dots, a path into it (\`draft.subject\`). It cannot hold an expression: a call, an index, a condition or an element is computed by the container that renders this screen, and handed in as an input`}]:Object.entries(n).flatMap(([e,n])=>M(n,`${t}.${e}`))}var Te=new Set([`component`,`props`,`children`,`exception`]);function N(e,t,n,r=new Map){if(Array.isArray(e))return e.forEach((e,i)=>N(e,`${t}[${i}]`,n,r)),r;if(typeof e!=`object`||!e)return r;let i=e,a=i.component,o=typeof a==`string`?n(a)?.props:void 0;for(let[e,s]of Object.entries(i)){if(o?.has(e)===!0&&!Te.has(e)){let n=j(String(a));r.set(`${t}.${e}`,`\`${e}\` is a prop of \`${n}\`, written here as a field of the element — a prop goes inside \`props\`: \`{ "component": "${n}", "props": { "${e}": … } }\``)}N(s,`${t}.${e}`,n,r)}return r}function Ee(e,t,n){n!==void 0&&e.inputs.forEach((e,r)=>{let i=n(e.type);i!==null&&t.push({path:`$.inputs[${r}].type`,message:`\`${j(e.type)}\` ${i} — an input's type is one TypeScript type, written into the props interface as it stands`})})}var De=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Oe=/^[^\s'"`\\]+$/,ke="A spec has no default or namespace import: name the type itself (`ReactNode`), and write it in the input’s type without the namespace (`ReactNode`, not `React.ReactNode`)";function Ae(e,t){for(let[n,r]of Object.entries(e.types??{}))Oe.test(n)||t.push({path:`$.types.${j(n)}`,message:`is not a module specifier — it is written between the quotes of an import, so it holds no quote, backslash or space`}),r.forEach((e,r)=>{De.test(e)&&!O.has(e)||t.push({path:`$.types.${j(n)}[${r}]`,message:`\`${j(e)}\` is not a type name — an import names identifiers`+(/\bas\b|\*/.test(e)?`. ${ke}`:``)})})}var je=e=>e.replace(`.`,``),Me=[`Component`,`input`];function Ne(e,t,n){let r=new Map;for(let t of e)r.set(t,`a member this screen composes`);if(n!==`angular`)return r;for(let e of Me)r.set(e,"a name from `@angular/core`");for(let e of t)r.set(je(e),`a member or part this screen composes`);return r}function Pe(e,t,n){let r=new Map(t);for(let[t,n]of Object.entries(e.types??{}))for(let e of n)r.set(e,`a type it imports from \`${t}\``);for(let t of[e.name,`${e.name}Props`]){let e=r.get(t);e!==void 0&&n.push({path:`$.name`,message:`the emitted file would both declare \`${t}\` and import it as ${e} — the declaration shadows the import, so name the screen something the file does not already hold`})}}var P=e=>e===`ios`||e===`android`,Fe={ios:`Swift`,android:`Kotlin`},F={ios:`SwiftUI`,android:`Compose`},Ie={ios:`packages/native/src/pending.ts`,android:`packages/native/src/kotlin-pending.ts`},I=`AppShell`,Le=`archetypes`,Re=[`empty`,`pending`],L={name:`onRetry`,type:`(() => void) | undefined`,optional:!0},ze=new Set([`Any Self Type as associatedtype async await break case catch class continue default defer`,`deinit do else enum extension fallthrough false fileprivate for func guard if import in init`,`inout internal is let nil operator private protocol public repeat rethrows return self static`,`struct subscript super switch throw throws true try typealias var where while`].flatMap(e=>e.split(` `))),Be=new Set([`as break class continue do else false for fun if in interface is null object package return`,`super this throw true try typealias typeof val var when while`].flatMap(e=>e.split(` `))),Ve=new Set([...Be,`equals`,`hashCode`,`toString`]);function R(e){return e.replace(/(View|Screen)$/,``)}function He(e,t){let n=R(t);return e===`ios`?[`${n}Model`,`${n}Actions`,`${n}View`]:[`${n}Model`,`${n}Actions`,`${n}Screen`,`${n}Inert`]}var Ue={ios:new Set([`AnyView`,`EmptyView`,`Group`,`Text`,`View`]),android:new Set([`Composable`,`Text`])},z=e=>e!==void 0&&e.tier===Le&&e.name!==I;function B(e,t,n){if(e===null||!P(n)||!z(e.component)||t!==e.component?.name||e.props.has(L.name))return e;let r=new Map(e.types);return r.set(L.name,L),{...e,props:new Set(r.keys()),types:r}}function We(e,t,n,r,i,o){let s=Fe[t],c=t===`ios`?ze:Ve,u=new Set(e.inputs.filter(e=>p(e.type)).map(e=>e.name));e.inputs.forEach((t,n)=>{let r=`$.inputs[${n}]`;t.name===`loadStatus`?i.push({path:`${r}.name`,message:"`loadStatus` is the model’s first field, which the root archetype draws the four load states from — name the input something else, and set the status in the app’s store"}):c.has(t.name)&&i.push({path:`${r}.name`,message:`\`${t.name}\` is a word ${s} has taken — every input is a field of the model or the actions, and no field can be called that`});let a=o.inputType===void 0?null:o.inputType(t.type);if(o.nativeType===void 0||a!==null)return;let l=o.nativeType(t,e);l!==null&&i.push({path:`${r}.type`,message:`\`${j(t.type)}\` ${l}`})}),z(n.get(e.root.component))||i.push({path:`$.root`,message:`a native screen’s root is a page archetype that draws the four load states, and \`${e.root.component}\` is not one — use ListPage, DetailPage, FormPage, Dashboard, SettingsPage, MasterDetailPage, SearchPage, ConversationPage or AuthPage`+(e.root.component===I?`; AppShell is the app’s frame around its router`:``)});let d=(e,t)=>{if(Array.isArray(e))e.forEach((e,n)=>d(e,`${t}[${n}]`));else if(_(e)){let[n=e.$,...r]=e.$.split(`.`);r.length>0&&u.has(n)&&i.push({path:t,message:`\`${e.$}\` is a path into the action \`${n}\`, and an action has no fields — bind \`${n}\` itself, or a model input`})}else if(l(e))for(let[n,r]of Object.entries(e.$object))d(r,`${t}.${n}`);else a(e)&&f(e,t)},f=(e,a)=>{let s=B(H(e.component,n,r),e.component,t),c=s?.component,l=c!==void 0&&e.component===c.name,f=e.props??{};s!==null&&G(e.component,s,t,`react`)===null&&o.renders!==void 0&&!o.renders(e.component)&&i.push({path:a,message:`\`${e.component}\` has no ${F[t]} rendering yet (\`${Ie[t]}\`), so a screen for ${t} that uses it would not compile — leave it out until it is drawn, or compose the screen from members that are`});for(let[t,n]of Object.entries(f)){let r=`${a}.props.${t}`;if(d(n,r),l&&z(c)&&Re.includes(t)){i.push({path:r,message:`\`${e.component}\`’s \`${t}\` is set from \`loadStatus\` on a native screen — remove it, and set the model’s \`loadStatus\` in the app’s store`});continue}let o=s?.types.get(t)?.type;o!==void 0&&(p(o)?_(n)?u.has(n.$.split(`.`)[0]??n.$)||i.push({path:r,message:`\`${t}\` is an event, and \`${n.$}\` is model data — bind it to a function-typed input, an action`}):i.push({path:r,message:`\`${t}\` is an event, and an event is handed an action — bind it to a function-typed input`}):_(n)&&u.has(n.$)&&i.push({path:r,message:`\`${t}\` holds data, and \`${n.$}\` is an action — bind it to a model input`}))}l&&c.grid!==null&&Ge(c,f,a,i);let m=e.children??[];m.forEach((e,t)=>{let n=`${a}.children[${t}]`;_(e)&&u.has(e.$)&&i.push({path:n,message:`a child is drawn, and \`${e.$}\` is an action — bind a model input`}),d(e,n)});let h=s?.types.get(`children`)?.type,g=m.flat(1/0).filter(e=>e!==null);h!==void 0&&/^string( \| undefined)?$/.test(h)&&g.length>1&&i.push({path:`${a}.children`,message:`\`${e.component}\` takes its children as one text on a native screen, and this has ${g.length} — join them in the app’s store and bind one input`})};f(e.root,`$.root`);let m=new Map;for(let[t,n]of Object.entries(e.types??{}))for(let e of n)m.set(e,t);let h=R(e.name),g=He(t,e.name);if(h===``){i.push({path:`$.name`,message:`\`${e.name}\` leaves no name once its suffix is gone, and the file declares ${A(g.map(e=>`\`<Name>${e}\``))} — name the screen for what it shows`});return}for(let e of g){let n=m.get(e);n!==void 0&&i.push({path:`$.name`,message:`the emitted file declares \`${e}\`, which \`types\` also names from \`${n}\` — name the screen something else`}),Ue[t].has(e)&&i.push({path:`$.name`,message:`the emitted file declares \`${e}\`, which it also uses from ${F[t]} — name the screen something else`})}}function Ge(e,t,n,r){let i=e.grid,a=t.variant,o=t.tone;for(let[t,i]of[[`variant`,a],[`tone`,o]])if(i!==void 0&&typeof i!=`string`){r.push({path:`${n}.props.${t}`,message:`\`${e.name}\`’s variant and tone are one lawful cell on a native screen, chosen in the spec — write \`${t}\` as a literal`});return}if(a===void 0==(o===void 0))return;let s=Object.entries(i).flatMap(([e,t])=>t.map(t=>({variant:e,tone:t}))).filter(e=>a===void 0?e.tone===o:e.variant===a);if(s.length<=1)return;let[c,l]=a===void 0?[`tone`,`variant`]:[`variant`,`tone`];r.push({path:`${n}.props.${c}`,message:`\`${e.name}\`’s variant and tone are one lawful cell on a native screen, and \`${String(a??o)}\` pairs with ${s.map(e=>`\`${a===void 0?e.variant:e.tone}\``).join(`, `)} — give \`${l}\` too`})}function V(e){let t=new Map;for(let n of e)n.name.includes(`.`)||t.set(n.name,n);return t}function H(e,t,n){let r=n.get(e);if(r){let e=V(r.props);return{props:new Set(e.keys()),types:e,primitive:r}}let i=t.get(e);if(i){let e=V(i.props);return{props:new Set(e.keys()),types:e,component:i}}let a=e.split(`.`),[o,s]=a,c=o===void 0?void 0:t.get(o);if(a.length!==2||c===void 0||s===void 0)return null;let l=c.parts.find(e=>e.name===s);if(l===void 0)return null;let u=new Map(l.props.map(e=>[e.name,e]));return{props:new Set(u.keys()),types:u,component:c,part:s}}function U(e,t,n){let r=new Set(e.parts.map(e=>e.name));return c(e,t,n).map(e=>e.name).filter(e=>r.has(e))}function W(e,t,n){let r=U(e,t,n).map(t=>`\`${e.name}.${t}\``);return r.length===0?`\`${e.name}\` has no parts`:`\`${e.name}\`’s parts are ${r.join(`, `)}`}function G(e,t,n,r){let{component:i,part:a}=t;return i===void 0||a===void 0||U(i,n,r).includes(a)?null:`\`${e}\` is not a part ${n===`web`?`in ${r}`:`on ${n}`} — ${W(i,n,r)} there`}function Ke(e,t,n,r){let i=e.split(`.`),[a,o]=i,s=a===void 0?void 0:t.get(a);return i.length!==2||s===void 0?null:c(s,n,r).some(e=>e.name===o)?` — it is a part in ${r} whose props the registry does not record, so a spec cannot compose it`:` — ${W(s,n,r)}`}function qe(e,t,n,r,i){let a=t.component??t.primitive;if(a===void 0||e.component!==a.name)return;let o=a.platforms[n];if(o.status!==`absent`)return;let s=o.substitute,c=s===void 0||s===`none`?`it has no substitute, so leave it out`:`use \`${s}\` instead`;i.push({path:r,message:`\`${a.name}\` is absent on ${n} — ${c}`+(o.reason===void 0?``:`. ${o.reason}`)})}function Je(e,t,n,r,i){let a=t.component??t.primitive;if(a===void 0||e.component!==a.name)return;let o=a.frameworks[n];o.status===`absent`&&i.push({path:r,message:`\`${a.name}\` is absent in ${n}`+(o.reason===void 0?``:` — ${o.reason}`)})}function Ye(e,t){if(!(t===null||typeof t==`string`||typeof t==`number`||typeof t==`boolean`)&&(!Array.isArray(t)||!t.every(e=>[`string`,`number`,`boolean`].includes(typeof e)))||/[(){}=>]/.test(e))return null;let n=e.split(`|`).map(e=>e.trim()).filter(e=>e!==``&&e!==`undefined`),r=0;for(let e of n){let n=/^(readonly\s+)?(.+)\[\]$/.exec(e),i=n?n[2]:null;if(i!==null){if(!K(i)||(r+=1,Array.isArray(t)&&t.every(e=>q(i,e))))return null;continue}if(!K(e)||(r+=1,!Array.isArray(t)&&q(e,t)))return null}return r===0?null:JSON.stringify(t)}function K(e){return!!([`string`,`number`,`boolean`,`null`,`true`,`false`].includes(e)||/^["'].*["']$/.test(e)||/^-?\d+(\.\d+)?$/.test(e))}function q(e,t){if(e===`string`)return typeof t==`string`;if(e===`number`)return typeof t==`number`;if(e===`boolean`)return typeof t==`boolean`;if(e===`null`)return t===null;if(e===`true`)return t===!0;if(e===`false`)return t===!1;let n=/^["'](.*)["']$/.exec(e);return n?t===n[1]:/^-?\d+(\.\d+)?$/.test(e)?t===Number(e):!1}function Xe(e,t,n,r){let i=e.grid;if(!i)return;let a=t.variant,o=t.tone;if(typeof a!=`string`)return;let s=i[a];if(s===void 0){r.push({path:`${n}.props.variant`,message:`\`${e.name}\` has no variant \`${a}\` — it has ${Object.keys(i).join(`, `)}`});return}typeof o==`string`&&!s.includes(o)&&r.push({path:`${n}.props.tone`,message:`\`${e.name}\` has no \`${a}\` × \`${o}\` cell — ${a} takes ${s.join(`, `)}`})}function J(e,t,n,r){let i=t.icon;if(typeof i!=`string`)return;let a=e.icons.roles.map(e=>e.name);if(a.includes(i))return;let o=a.filter(e=>e.includes(i)||i.includes(e)).slice(0,3);r.push({path:`${n}.props.icon`,message:`\`${i}\` is not an icon role — the set is closed`+(o.length===0?``:`, did you mean ${o.map(e=>`\`${e}\``).join(`, `)}?`)})}var Y=e=>e===void 0?void 0:typeof e==`string`?e:null;function Ze(e,t,n){let r=[],i=(e,t)=>{let r=e.map((e,n)=>({item:e,at:`${t}[${n}]`})),i=({item:e})=>a(e)&&e.component===`Separator`;for(let e of ye(r,i)){let r=e.flatMap(({item:e,at:t})=>a(e)&&e.component===`Button`?[{tone:Y(e.props?.tone),at:t}]:[]);for(let e of be(r.map(({tone:e})=>[e])))n.push({path:r[e]?.at??t,message:`a danger Button before another Button in its group — the destructive one comes last, so the safe one is met first; move it last, or into a group of its own`})}},o=(e,t,n)=>{if(Array.isArray(e))i(e,t),e.forEach((e,r)=>o(e,`${t}[${r}]`,n));else if(l(e))for(let[r,i]of Object.entries(e.$object))o(i,`${t}.${r}`,n);else a(e)&&s(e,t,n)},s=(e,i,a)=>{if(e.component===`Bespoke`)return;let s=e.props??{};if(e.component===`Button`){me(Y(s.variant),Y(s.tone))===!0&&a!==null&&a.buttons.push(i);let e=s.trailingIcon;t!==void 0&&typeof e==`string`&&!xe(e,t)&&n.push({path:`${i}.props.trailingIcon`,message:`\`${e}\` does not trail its text — an icon leads its text, and only ${A(t.map(e=>`\`${e}\``))} trail it; `+(s.icon===void 0?`make it \`"icon": "${e}"\``:`drop it, or make it \`"icon": "${e}"\` in place of the other`)})}let c=ge(e.component),l=c===null?a:{name:c.name,scope:c.scope,buttons:[]};c!==null&&l!==null&&r.push(l);for(let[e,t]of Object.entries(s)){let n=c!==null&&c.scope.outside.includes(e);o(t,`${i}.props.${e}`,n?a:l)}e.children!==void 0&&o(e.children,`${i}.children`,l)};s(e,`$.root`,null);for(let e of r)for(let t of ve(e.buttons.map(()=>[])))n.push({path:e.buttons[t]??`$.root`,message:`a second main Button in this \`${e.name}\` — a ${e.scope.kind} has one solid accent Button, which marks its next step; make this one \`"variant": "outline", "tone": "neutral"\``})}function X(e,t,n,r){let i=t?.primitive?.rung??(e.props?.[Se]===void 0?null:3),a=e.exception;if(a===void 0){i!==null&&r.push({path:n,message:`\`${e.component}\` is a rung-${i} exception and is not declared — add "exception": { "rung": ${i}, "because": "…" }`});return}if(i===null){r.push({path:`${n}.exception`,message:`\`${e.component}\` takes no exception — nothing here deviates from the vocabulary`});return}D.includes(a.rung)?a.rung!==i&&r.push({path:`${n}.exception.rung`,message:`\`${e.component}\` is rung ${i}, declared as rung ${a.rung}`}):r.push({path:`${n}.exception.rung`,message:`rung ${a.rung} is not something a screen can declare — ${D.join(`, `)} are`}),a.because.trim().split(/\s+/).length<4&&r.push({path:`${n}.exception.because`,message:`say why the vocabulary was not enough — this is read by whoever finds it later`})}var Z=e=>e.replace(/[^a-z0-9]/gi,``).toLowerCase();function Qe(e,t,n,r){let i=Z(t),a=[...n.keys(),...r.keys()].filter(e=>Z(e).includes(i)||i.includes(Z(e))),o=t.toLowerCase(),s=e.components.filter(e=>e.purpose.toLowerCase().includes(o)).map(e=>e.name),c=[...new Set([...a,...s])].slice(0,3);return c.length===0?``:` — did you mean ${c.map(e=>`\`${e}\``).join(`, `)}?`}var $e=4;function et(e,t){let n=Z(e),r=[...t].filter(e=>{let t=Z(e);return Math.min(t.length,n.length)<$e?!1:t.includes(n)||n.includes(t)});return r.length===0?``:` — did you mean \`${r[0]}\`?`}function tt(e,t={}){let n=C(e);if(n!==null)return{ok:!1,faults:[{path:n,message:w}]};let r=t.vocabulary??te,{faults:i}=we(r,e,{},{...t.framework===void 0?{}:{framework:t.framework}}),a=[...i,...rt(r,e,m(r,t),new Set(i.map(({path:e})=>e)))];return{ok:a.length===0,faults:a}}var Q=e=>typeof e==`object`&&!!e&&!Array.isArray(e),nt=e=>Q(e)&&typeof e.component==`string`;function rt(e,a,o,c){let l=[],p=(e,t,n)=>{if(!(Q(t)&&typeof t.$==`string`))for(let r of d(e,t,n))c.has(r.path)||l.push(r)},m=new Map,g=(t,r,a)=>{let o=n(e,t),c=r.name;if(o===null||i(o)===null||typeof c!=`string`||c===``)return;let u=`${a}.props.name`;if(f.has(c)){l.push({path:u,message:s(c)});return}let d=m.get(c);d!==void 0&&l.push({path:u,message:ue(c,d)}),m.set(c,a)},_=(e,t)=>{c.has(e)||l.push({path:e,message:t})},v=new Set,C=Q(a)?a.inputs:void 0;Array.isArray(C)&&C.forEach((e,t)=>{if(!Q(e)||typeof e.name!=`string`)return;let n=e.type;typeof n==`string`&&(n.length>500?_(`$.inputs[${t}].type`,r(e.name,n.length)):y(n)&&v.add(e.name))});let w=(r,i,a,s=!1)=>{if(Array.isArray(r)){let t=ce(e,a);r.forEach((e,n)=>w(e,`${i}[${n}]`,t,s));return}if(!Q(r))return;if(typeof r.$==`string`){let t=r.$;v.has(t)&&le(e,a)===null&&_(i,oe(t));return}if(typeof r.component==`string`){let a=r.component,c=h(e,a,o);c!==null&&l.push({path:i,message:c});let d=n(e,a),f=new Map((d?.props??[]).map(e=>[e.name,e.type])),m=Q(r.props)?r.props:{},v=(d?.props??[]).some(t=>!t.optional&&t.name!==`children`&&!y(t.type)&&(!x(e,t.type)||T(e,t.type))&&!Object.prototype.hasOwnProperty.call(m,t.name)),S=s||v;S||g(a,m,i);for(let[n,r]of Object.entries(m)){if(n.length>100){_(i,u(n.length));continue}let a=`${i}.props.${n}`;T(e,f.get(n)??null)&&!nt(r)&&_(a,b(n)),t.has(n)&&p(n,r,a),w(r,a,f.get(n)??null,S)}w(r.children,`${i}.children`,f.get(`children`)??null,S);return}let c=r.$object;if(Q(c))for(let[n,r]of Object.entries(c)){if(n.length>100){_(i,u(n.length));continue}let o=`${i}.${n}`,c=ee(e,a,n),l=r;if(c!==null&&!x(e,c?.type??`never`)){let t=ne(e,a),i=c===void 0?S(n,t):ie(n,t);if(ae(e,c)){let e=re(r);if(e.removed&&_(o,i),e.value===void 0)continue;l=e.value}else if(se(r)){_(o,i);continue}}t.has(n)&&p(n,l,o),w(l,o,c?.type??null,s)}};return Q(a)&&w(a.root,`$.root`,null),l}var it=e({checkScreen:()=>$});function $(e,t={}){return tt(e,{...t,framework:`elements`})}export{it as n,$ as t};